Services count
Basic count module used mostly in other modules due to its ability to validate count_
columns and ignore _buildings
columns.
[1]:
import pandas as pd
blocks_gdf = pd.read_pickle('./../../data/saint_petersburg/blocks.pickle')
[3]:
from blocksnet.analysis.services import services_count
count_df = services_count(blocks_gdf)
count_df.head()
[3]:
count_school | count_kindergarten | count_hospital | count_polyclinic | count_pitch | count_swimming_pool | count_theatre | count_museum | count_cinema | count_mall | ... | count_bus_station | count_bus_stop | count_pier | count_animal_shelter | count_prison | count_landfill | count_plant_nursery | count_greenhouse_complex | count_warehouse | count | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4 | 1 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | ... | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
5 rows × 61 columns
[5]:
blocks_gdf[['geometry']].join(count_df).plot('count', figsize=(10,8), legend=True).set_axis_off()
