<jupyter_start><jupyter_text>Join two dataframes using pd.merge function. Use the following resources.https://pandas.pydata.org/pandas-docs/stable/user_guide/merging.htmlhttps://datacarpentry.org/python-ecology-lesson/05-merging-data/index.html<jupyter_code># this function joins the right table to the left table. To understand the arguments here refer to the user guide of Pandas.
# Also notice that here we defined the key columns in each table. 'GISJOIN' is the key (matching) column in both tables
df_joined = pd.merge(left=df_my_bg, right=df_new_cols, how='left', left_on='GISJOIN', right_on='GISJOIN')
# df_joined.sample(4)
df_my_bg.columns
df_new_cols.columns
df_joined.columns
len(df_my_bg)
len(df_new_cols)
len(df_joined)
df_joined.to_csv(r"C:\MyFiles\Dropbox\Teaching\Urban_Data_Analsysis\Fall 2020\Data\NYC_BlockGroups\NYCBlockGroups_joined_with_educationData.csv")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10143329658213891, 'fraction_numerical': 0.007717750826901874, 'mean_word_length': 7.035398230088496, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '233817', 'license': 'MIT', 'n_tokens_mistral': 339, 'n_tokens_neox': 324, 'n_words': 68, 'path': 'TableJoin.ipynb', 'repo_name': 'mehdiheris/Urban_Data_Analytics_Course', 'size': '907'}