Give Me More Business for My Cart




Pay Notebook Creator: Stelios Phanartzis0
Set Container: Numerical CPU with TINY Memory for 10 Minutes 0
Total0
In [2]:
#Imports Data from Food Vendor Table
#Render table
#Preview table
import pandas as pd
#Food Vendor Table
fv_url = 'https://data.cityofnewyork.us/resource/d9fw-zp4j.json'
#Restaurant Grade Table
rg_url = 'https://data.cityofnewyork.us/resource/xx67-kt59.json'
In [3]:
#Possible Links
##https://www.nycgovparks.org/bigapps/DPR_Eateries_001.json
##https://www.nycgovparks.org/bigapps/DPR_Concessions_001.json
##https://data.cityofnewyork.us/resource/czg9-hfnz.json
##https://data.cityofnewyork.us/resource/mp9e-iwqn.json
##https://data.cityofnewyork.us/resource/8iba-ij2b.json

#Load Food Vendor Table
fv_t = pd.read_json(fv_url)
#Select columns to create a filtered table
fv_ft = fv_t[['company_name','address','subindustry','sub_subindustry','postcode']][0:]
In [4]:
fv_ft
Out[4]:
<style scoped> .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } </style>
company_name address subindustry sub_subindustry postcode
0 Europa Cafe 3 Times Sq Café / Deli NaN 10036.0
1 Ranch 1 832 Eighth Ave Quick Serve Fast Food 10019.0
2 Sosa Borella 832 Eighth Ave Full Serve Argentinian 10019.0
3 Mi Nidito (Cantina Mexicana) 852 Eighth Ave Full Serve Mexican 10019.0
4 Starbucks 871-879 Eighth Ave, Suite# 871 Coffee NaN 10019.0
5 China Gourmet 877 Eighth Ave Full Serve Chinese 10019.0
6 Rino Trattoria 877 Eighth Ave Full Serve Italian 10019.0
7 Laxmi Corp. Newsstand 879 Eighth Ave Café / Deli NaN 10019.0
8 Caffe Cielo 881 Eighth Ave Full Serve Italian 10019.0
9 Cosmic Diner 888 Eighth Ave Full Serve Diner 10019.0
10 Brasserie Athena 300 W 46th St Full Serve French 10036.0
11 The House of Brews 302 W 51st St Full Serve American 10019.0
12 Seasons 888 Eighth Ave Full Serve American 10019.0
13 World of Nuts and Ice Cream 888 Eighth Ave Quick Serve Dessert 10019.0
14 Green Emporium 791 Eighth Ave Café / Deli NaN 10019.0
15 Rosie O'Grady's Saloon 800 Seventh Ave Full Serve American 10019.0
16 810 Deli, Inc 810 Seventh Ave Café / Deli NaN 10019.0
17 Deli / Café 810 Seventh Ave Café / Deli NaN 10019.0
18 Ichi Masa Japanese Sushi 825 Eighth Ave Full Serve Japanese 10019.0
19 Starbucks 825 Eighth Ave Coffee NaN 10019.0
20 Starbucks 156 W 52nd St Coffee NaN 10019.0
21 The Library @ Paramount Hotel 235 W 46th St Full Serve American 10036.0
22 46 Bar (Paramount Hotel) 235 W 46th St Bar / Lounge NaN 10036.0
23 Victor's Cafe 236 W 52nd St Café / Deli NaN 10019.0
24 Auntie Anne's 664 Eighth Ave Quick Serve Fast Food 10036.0
25 B.B. King Blues Club & Grill 237 W 42nd St Full Serve American 10036.0
26 Cold Stone Creamery/ Tim Horton's 243 W 42nd St Quick Serve Dessert 10036.0
27 Dallas BBQ 27 West 72nd Street Full Serve Barbecue 10023.0
28 Starbucks 251 W 42nd St Coffee NaN 10036.0
29 Pongsri Thai Restaurant 244 W 48th St Full Serve Thai 10036.0
... ... ... ... ... ...
301 Mama Sbarro's 1606 Broadway Quick Serve Pizza 10019.0
302 Yoshinoya Beef Bowl Restaurant 255 W 42nd St Full Serve Japanese 10036.0
303 Natsumi Restaurant, Bar & Lounge 226 W 50th St Full Serve Japanese 10019.0
304 Brooklyn Diner 155 W 43rd St Full Serve Diner 10036.0
305 Chevys Fresh Mex 259 W 42nd St Full Serve Mexican 10036.0
306 Tasti D-Lite 1588 Broadway Quick Serve Dessert 10036.0
307 Carve: Unique Sandwiches 768 Eighth Ave Quick Serve American 10036.0
308 Starbucks (@ Marriott) 1535 Broadway Coffee NaN 10036.0
309 Ray's Famous Pizza 736 Seventh Ave Quick Serve Pizza 10019.0
310 Jamba Juice 1700 17th Street Café / Deli NaN NaN
311 vacant (8th Avenue Pavilion Flea Market) 675 Eighth Ave Consumables Non-beverages 10036.0
312 Bond 45 154 West 45th St Full Serve Italian 10036.0
313 Pax World 225 W 42nd St Café / Deli NaN 10036.0
314 705 8th Avenue (8th Avenue Food Court) 705 Eighth Ave\nStorefront Café / Deli NaN 10036.0
315 Avenue Restaurant @ Sheraton Hilton Hotel 811 Seventh Ave Full Serve American 10019.0
316 Azalea 224 W 51st St Full Serve Italian 10019.0
317 Bella Vita 211 W 43rd St Full Serve Italian 10036.0
318 Bistro Caterers 155 W 51st St Catering NaN 10019.0
319 CAFÉ @ Times Square 159 W 46th St Café / Deli NaN 10036.0
320 Chipotle Mexican grill 854 Eighth Ave Quick Serve Mexican 10019.0
321 Famous Dave's B-B-Q 169 W 47th St Full Serve Barbecue 10036.0
322 Famous Famiglia Pizza 686 Eighth Ave Quick Serve Pizza 10036.0
323 Fu Ying 811 Eighth Ave Quick Serve Chinese 10019.0
324 Green Symphony 255 W 43rd St Full Serve Organic 10036.0
325 Haru 205 W 43rd St Full Serve Japanese 10036.0
326 Insieme @ The Michaelangelo 777 Seventh Ave Full Serve Italian 10019.0
327 Starbucks 684 Eighth Ave Coffee NaN 10036.0
328 Metromet, Inc. 224 West 49th Street\nSuite 1619 Catering NaN 10019.0
329 Barbetta Restaurant 321 West 46th Street Full Serve Italian 10036.0
330 Le Bernardin 155 West 51st. Full Serve French NaN
<p>331 rows × 5 columns</p>
In [9]:
#Load Restaurant Grade Table
rg_t = pd.read_json(rg_url)
#Select columns to create a filtered table
rg_ft = rg_t[['dba','boro','street','zipcode','cuisine_description','grade','score']][0:]
In [11]:
rg_ft
Out[11]:
<style scoped> .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } </style>
dba boro street zipcode cuisine_description grade score
0 MORRIS PARK BAKE SHOP BRONX MORRIS PARK AVE 10462 Bakery A 7.0
1 MORRIS PARK BAKE SHOP BRONX MORRIS PARK AVE 10462 Bakery A 7.0
2 MORRIS PARK BAKE SHOP BRONX MORRIS PARK AVE 10462 Bakery A 10.0
3 MORRIS PARK BAKE SHOP BRONX MORRIS PARK AVE 10462 Bakery A 10.0
4 MORRIS PARK BAKE SHOP BRONX MORRIS PARK AVE 10462 Bakery A 6.0
5 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers A 10.0
6 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers A 10.0
7 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers NaN 7.0
8 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers A 11.0
9 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers A 11.0
10 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers NaN 48.0
11 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers NaN 48.0
12 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers NaN 48.0
13 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers NaN 48.0
14 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers NaN 48.0
15 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers A 13.0
16 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers A 13.0
17 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers A 13.0
18 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers A 13.0
19 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers NaN NaN
20 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers NaN NaN
21 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers NaN 0.0
22 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers A 12.0
23 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers A 12.0
24 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers A 8.0
25 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers A 8.0
26 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers NaN 14.0
27 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers NaN 14.0
28 WENDY'S BROOKLYN FLATBUSH AVENUE 11225 Hamburgers NaN 14.0
29 DJ REYNOLDS PUB AND RESTAURANT MANHATTAN WEST 57 STREET 10019 Irish A 10.0
... ... ... ... ... ... ... ...
970 THE GEORGIAN SUITE KITCHEN MANHATTAN EAST 77 ST 10021 Continental A 9.0
971 THE GEORGIAN SUITE KITCHEN MANHATTAN EAST 77 ST 10021 Continental NaN 21.0
972 THE GEORGIAN SUITE KITCHEN MANHATTAN EAST 77 ST 10021 Continental NaN 21.0
973 THE GEORGIAN SUITE KITCHEN MANHATTAN EAST 77 ST 10021 Continental NaN 21.0
974 THE GEORGIAN SUITE KITCHEN MANHATTAN EAST 77 ST 10021 Continental A 13.0
975 THE GEORGIAN SUITE KITCHEN MANHATTAN EAST 77 ST 10021 Continental A 13.0
976 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American A 12.0
977 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American A 12.0
978 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American A 12.0
979 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American NaN 13.0
980 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American NaN 13.0
981 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American NaN 13.0
982 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American NaN 13.0
983 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American NaN NaN
984 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American B 14.0
985 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American B 14.0
986 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American B 14.0
987 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American NaN 12.0
988 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American NaN 12.0
989 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American NaN 12.0
990 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American B 24.0
991 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American B 24.0
992 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American B 24.0
993 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American B 24.0
994 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American B 24.0
995 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American NaN 32.0
996 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American NaN 32.0
997 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American NaN 32.0
998 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American NaN 32.0
999 OLD HOMESTEAD MANHATTAN 9 AVENUE 10011 American NaN 32.0
<p>1000 rows × 7 columns</p>
In [ ]:
fv_zip = []
#Create List of Unique Zipcodes from Food Vendor Data
for i in range(0,len(fv_ft[['postcode']])):
    item = fv_ft.iloc[i]['postcode']
    if((item not in fv_zip) and (item*1 == item)):
        fv_zip.append(int(item))
In [1]:
#Filters Restaurant Grade Table using Food Vendor Zipcodes
#for i in range(0,len(rg_ft[['zipcode']])):
#    item = rg_ft.iloc[i]['zipcode']
#    if((item not in fv_zip)):
#        rg_ft.drop(rg_ft.index[i], inplace = True)
#rg_ft.drop(rg_ft.iloc[:]['zipcode'] not in fv_zip, inplace = True)
#print(rg_ft)
In [ ]: