# CrossCompute
target_folder = '/tmp'
import geotable
url2 = "https://www1.nyc.gov/assets/planning/download/zip/data-maps/open-data/nynta_18d.zip"
nta = geotable.load(url2)
#nta.draw()
nta.iloc[0]
#Import ACS dataset on median income by NTA
import pandas as pd
acs = pd.read_excel("https://www1.nyc.gov/assets/planning/download/office/data-maps/nyc-population/acs/econ_2016acs5yr_nta.xlsx?r=1")
acs = acs.set_index("GeoID")
incomes = acs['MdFamIncE']
nta = nta.set_index('NTACode')
nta['Median Income'] = incomes
nta[:3]
Map_geotable = nta.copy()
Map_geotable['fill_greens'] = Map_geotable['Median Income']
target_path = target_folder + '/choropleth.csv'
Map_geotable.to_csv(target_path, index=False)
print('a_geotable_path = %s' % target_path)
Map_geotable.draw()