Give Me More Business for My Cart




Pay Notebook Creator: Stelios Phanartzis0
Set Container: Numerical CPU with TINY Memory for 10 Minutes 0
Total0

.Milestone 1

Plot Food Vendors on Map

In [1]:
#CrossCompute
target_folder = '/tmp/foodvendors'
In [2]:
import pandas as pd
vendor_table_path = 'Times_Square_Food___Beverage_Locations.csv'
location_table_path = 'Locations.csv'
eat_url = 'https://www.nycgovparks.org/bigapps/DPR_Eateries_001.json'
eat_ref = 'Fvt_Lat_Long.csv'
In [3]:
fv_t = pd.read_csv(vendor_table_path)
lc_t = pd.read_csv(location_table_path)
eat_t = pd.read_json(eat_url)
eat_ref_t = pd.read_csv(eat_ref)
In [4]:
fv_t = fv_t.dropna(subset=['Latitude','Longitude'])
lc_t = lc_t.dropna(subset=['Lat1'])
eat_t = pd.concat([eat_t,eat_ref_t],axis=1)
In [5]:
fv_t = fv_t[['Address','Company Name','Latitude','Location 1','Longitude','Phone','Subindustry','Sub Subindustry','Website']]
eat_t = eat_t[['park_id','name','latitude','longitude','phone','type_name','Unnamed: 3','website']][0:]
eat_t.columns = ['Address','Company Name','Latitude','Location 1','Longitude','Phone','Subindustry','Sub Subindustry','Website']
combvend_t = pd.concat([fv_t, eat_t])
In [6]:
# target_path = target_folder + '/foodVendorMap.csv'
# combvend_t.to_csv(target_path, index=False)
In [7]:
# print('vendor_geotable_path = %s' % target_path)
# combvend_t.to_csv(target_path, index=False)
In [8]:
from os.path import join
from invisibleroads_macros.disk import make_folder
from shutil import copy
target_path =  join(make_folder(target_folder),'foodVendorMap.csv')
combvend_t.to_csv(target_path, index=False)
print('location_geotable_path = %s' % target_path)
location_geotable_path = /tmp/foodvendors/foodVendorMap.csv
In [ ]: