Created
April 24, 2022 16:59
-
-
Save SebastianoF/ac005e11bf79ca4a8779cf00e426b2b1 to your computer and use it in GitHub Desktop.
b001_13.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
number_of_offices = len(df_commuter.groupby(["workplace_lng", "workplace_lat"]).count()) | |
number_of_residences = len(df_commuter.groupby(["residence_lng", "residence_lat"]).count()) | |
number_of_offices_in_london_and_city = len(df_commuter_london_office.groupby(["workplace_lng", "workplace_lat"]).count()) | |
number_of_residences_commuting_to_london_and_city = len(df_commuter_london_office.groupby(["residence_lng", "residence_lat"]).count()) | |
commuters_office_ratio = number_of_residences / number_of_offices | |
commuters_office_ratio_in_london_and_city = number_of_residences_commuting_to_london_and_city / number_of_offices_in_london_and_city | |
print(f"Number of offices in london and the city {number_of_offices_in_london_and_city} ({number_of_offices_in_london_and_city / number_of_offices} %)") | |
print(f"Number of residences commuting to london and the city {number_of_residences_commuting_to_london_and_city} ({number_of_residences_commuting_to_london_and_city / number_of_residences} %)") | |
print(f"Number of commuters residences per office {commuters_office_ratio}") | |
print(f"Number of commuters residences per office in london and the city {commuters_office_ratio_in_london_and_city}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment