#Name: Paul Grant #Email: paul.grant26@myhunter.cuny.edu #Title: Who Speaks What Where in NYC? #URL: https://whospeakswhatwhere.godaddysites.com/#f46cb330-fa32-4b0e-9dea-b8d1ca5b6731 #Resources: https://www1.nyc.gov/assets/planning/download/pdf/data-maps/nyc-population/acs/top_lang_2015pums5yr_nyc.pdf import pandas as pd import csv #Get input file name (datascienceproj.csv): inFile = input("Enter input file name: ") #Open input CSV in a df: df = pd.read_csv(inFile, index_col=0) #--------------------------------------------------------------------------------------- #Only choose between a, b or c where_to_go = input("Please enter letter to choose what to do: ") if where_to_go == "a": #test to show if a language is spoken in a certain borough/area #first, find the name of the area you want place_name = input("Enter place name: ") #if the area does not appear in the top row... for col_name in df.columns: if place_name == col_name: #we ask for the name of the language. lang_name = input("Enter language name: ") for row_name in df.columns: #... return final result if row_name != "N/A": print("Yes, " + lang_name + " is spoken in " + place_name + ".\n") #--------------------------------------------------------------------------------------- if where_to_go == "b": #test to show how many people speak a given language in a certain area place_name = input("Enter place name: ") for col_name in df.columns: if place_name == col_name: lang_name = input("Enter language name: ") for i in row: if row == lang_name: print(row[] + " people speak " + lang_name + " in " + place_name + ".\n") #--------------------------------------------------------------------------------------- if where_to_go == "c": #test to show if language is spoken across all five boroughs #this time, we start by asking for the language: lang_name = input("Enter language name: ") for col_name in df.columns: if lang_name != "N/A": print("Yes, " + lang_name + " is spoken in all 5 boroughs.\n ")