<jupyter_start><jupyter_text>Segmenting and Clustering Neighborhoods in Toronto. Part 2 1. Import libraries<jupyter_code>import pandas as pd<jupyter_output><empty_output><jupyter_text>2. Loading df from part 1<jupyter_code>postal_codes = pd.read_csv("Toronto_postal_codes.part_1.csv")
postal_codes<jupyter_output><empty_output><jupyter_text>3. Preparing geodata The approach with 'geocoder' library didn't work for me, so I load coordinates from file Geospatial_Coordinates.csv.<jupyter_code>Geo_data = pd.read_csv("Geospatial_Coordinates.csv")
Geo_data.rename(columns={"Postal Code": "PostalCode"}, inplace=True)
Geo_data<jupyter_output><empty_output><jupyter_text>4. Merging postcode df with geodata df<jupyter_code>neighborhoods = postal_codes.merge(Geo_data, on="PostalCode", how="left")
neighborhoods<jupyter_output><empty_output><jupyter_text>4. Saving dataframe for the future use<jupyter_code># Save to the file
neighborhoods.to_csv('Neighborhoods.part_2.csv', index=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10286844708209693, 'fraction_numerical': 0.008902077151335312, 'mean_word_length': 10.5, 'pattern_counts': {'":': 1, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '370417', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 383, 'n_tokens_neox': 367, 'n_words': 67, 'path': '2.Segmenting & Clustering Neighborhoods in Toronto.ipynb', 'repo_name': 'atelon/Coursera_Capstone', 'size': '1011'}