ECSP




Pay Notebook Creator: Haige Cui0
Set Container: Numerical CPU with TINY Memory for 10 Minutes 0
Total0
In [1]:
# CrossCompute
ready_table_path = 'Table with periodic savings(within 0.5 Mile) and tree count(within 0.5 Mile).csv'
target_folder = '/tmp'

Load Arguments

In [2]:
import pandas as pd
ready_table = pd.read_csv(ready_table_path)
In [3]:
ready_table.head()
Out[3]:
<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>
Unnamed: 0 Company Name Address Industry Program Effective Date Savings Borough Latitude Longitude Month Count Periodic Savings over Months Total Tree Count within 0.5 Mile Periodic Savings within 0.5 Mile
0 0 139 ACA Realty, Inc. 43-23 35th Street Commercial ICIP 2008-04-07 123975.24 QUEENS 40.745706 -73.929565 116 1068.75 1331 1419.727333
1 1 141 Lake Avenue Realty c/o JR Produce, Inc. 141 Lake Avenue Wholesale/Warehouse/Distribution ICIP 2009-12-08 47512.89 STATEN IS 40.633153 -74.150999 96 494.93 1390 336.525000
2 2 14-10 123rd Street LLC 14-10 123rd Street Commercial ICIP 2011-03-04 21322.89 QUEENS 40.785144 -73.844833 81 263.25 2195 1079.380000
3 3 183 Lorriane Street LLC 183 Lorraine Street Wholesale/Warehouse/Distribution ICIP 2015-11-06 105016.49 BROOKLYN 40.673106 -74.002300 25 4200.66 1254 2846.165714
4 4 21st Century Optics, Inc. 47-00 33rd Street Manufacturing Tenant 2009-01-07 215757.20 QUEENS 40.742386 -73.932148 107 2016.42 1136 1517.730217
In [4]:
len(ready_table)
Out[4]:
516
In [5]:
ready_table.drop(ready_table.columns[[0,1]], axis=1, inplace=True)
ready_table.head()
Out[5]:
<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>
Address Industry Program Effective Date Savings Borough Latitude Longitude Month Count Periodic Savings over Months Total Tree Count within 0.5 Mile Periodic Savings within 0.5 Mile
0 43-23 35th Street Commercial ICIP 2008-04-07 123975.24 QUEENS 40.745706 -73.929565 116 1068.75 1331 1419.727333
1 141 Lake Avenue Wholesale/Warehouse/Distribution ICIP 2009-12-08 47512.89 STATEN IS 40.633153 -74.150999 96 494.93 1390 336.525000
2 14-10 123rd Street Commercial ICIP 2011-03-04 21322.89 QUEENS 40.785144 -73.844833 81 263.25 2195 1079.380000
3 183 Lorraine Street Wholesale/Warehouse/Distribution ICIP 2015-11-06 105016.49 BROOKLYN 40.673106 -74.002300 25 4200.66 1254 2846.165714
4 47-00 33rd Street Manufacturing Tenant 2009-01-07 215757.20 QUEENS 40.742386 -73.932148 107 2016.42 1136 1517.730217
In [6]:
#ready_table = ready_table[['Longitude','Latitude','Total Tree Count within 0.5 Mile','Periodic Savings within 0.5 Mile']]
#ready_table=ready_table
len(ready_table)
Out[6]:
516
In [16]:
len(ready_table)
Out[16]:
516

Render Map

In [17]:
ready_geotable = ready_table.copy()  # Prevent SettingwithCopyWarning
In [18]:
# Set radius for each point
# The bigger the circle, the more the company saved
ready_geotable['RadiusInPixelsRange5-50'] = ready_geotable['Periodic Savings over Months']
In [19]:
# Set color for each point using a gradient
# The darker the color, the more trees the company is surrounded by
ready_geotable['FillRedsFromMean'] = ready_geotable['Total Tree Count within 0.5 Mile']

Hypothesis:<br>

  • Bigger circle tend to be darker<br>
  • Also, companies who saved the more money tend to be surrounded by more trees.<br> Discovery:
  • Biggest circles are found in Bronx and STATEN IS<br>
  • Bigger circles in Bronx are indeed surrounded by more trees<br> (ex.Albert Einstein College of Medicine of Yeshiva Uni, saved 102919.54, 419 trees<br> Montefiore Medical Center, saved 11400.63 in ICAP and 69506.82 in ICIP, 303 trees) <br>
  • While the biggest circle of all is found in Stanley IS but the color is near transparent(means very few trees around) (ex.VISY PAPER RECYCLING saved 274038.51, 41 trees)
In [20]:
# See what we did
ready_geotable[:3]
Out[20]:
<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>
Address Industry Program Effective Date Savings Borough Latitude Longitude Month Count Periodic Savings over Months Total Tree Count within 0.5 Mile Periodic Savings within 0.5 Mile RadiusInPixelsRange5-50 FillRedsFromMean
0 43-23 35th Street Commercial ICIP 2008-04-07 123975.24 QUEENS 40.745706 -73.929565 116 1068.75 1331 1419.727333 1068.75 1331
1 141 Lake Avenue Wholesale/Warehouse/Distribution ICIP 2009-12-08 47512.89 STATEN IS 40.633153 -74.150999 96 494.93 1390 336.525000 494.93 1390
2 14-10 123rd Street Commercial ICIP 2011-03-04 21322.89 QUEENS 40.785144 -73.844833 81 263.25 2195 1079.380000 263.25 2195
In [21]:
# Save file to target folder to include it in the result download
target_path = target_folder + '/b.csv'
ready_geotable.to_csv(target_path, index=False)
print(f'b_geotable_path = {target_path}')  # Print geotable_path to render map
b_geotable_path = /tmp/b.csv