<jupyter_start><jupyter_text>Import all the Final (transformed)Data<jupyter_code>Rental_craigslist = pd.read_csv(os.path.join("..", "Output", 'Rental_Craigslist.csv'))
Rental_kijiji = pd.read_csv(os.path.join("..", "Output", 'Rental_Kijiji.csv'))
crime_data = pd.read_csv(os.path.join("..", "Output", 'Crime.csv'))
bridge_table = pd.read_csv(os.path.join("..", "Output", 'Bridge_Rental_Crime_Craigslist.csv'))
bridge_table_kijiji = pd.read_csv(os.path.join("..", "Output", 'bridge_table_kijiji_final.csv'))
community_services_table = pd.read_csv(os.path.join("..", "Output", 'community_assets.csv'))
fsa_income_table=pd.read_csv(os.path.join("..", "Output", 'Toronto_FSA_Final.csv'))
fsa_income_table=pd.read_csv(os.path.join("..", "Output", 'Toronto_FSA_Final.csv'))
#DF.to_csv('Output/Rental_Craigslist.csv', index=False)
#crime_data.to_csv('Output/Crime.csv', index=False)
#bridge_table.to_csv('Output/Bridge_Rental_Crime_Craigslist.csv')<jupyter_output><empty_output><jupyter_text>Create database connection<jupyter_code>connection_string = "postgres:postgres@localhost:5432/ETL_Rental_DB"
engine = create_engine(f'postgresql://{connection_string}', echo=True)
engine.table_names()<jupyter_output>2020-08-15 20:33:11,173 INFO sqlalchemy.engine.base.Engine select version()
2020-08-15 20:33:11,174 INFO sqlalchemy.engine.base.Engine {}
2020-08-15 20:33:11,178 INFO sqlalchemy.engine.base.Engine select current_schema()
2020-08-15 20:33:11,180 INFO sqlalchemy.engine.base.Engine {}
2020-08-15 20:33:11,189 INFO sqlalchemy.engine.base.Engine SELECT CAST('test plain returns' AS VARCHAR(60)) AS anon_1
2020-08-15 20:33:11,190 INFO sqlalchemy.engine.base.Engine {}
2020-08-15 20:33:11,200 INFO sqlalchemy.engine.base.Engine SELECT CAST('test unicode returns' AS VARCHAR(60)) AS anon_1
2020-08-15 20:33:11,201 INFO sqlalchemy.engine.base.Engine {}
2020-08-15 20:33:11,203 INFO sqlalchemy.engine.base.Engine show standard_conforming_strings
2020-08-15 20:33:11,204 INFO sqlalchemy.engine.base.Engine {}
2020-08-15 20:33:11,219 INFO sqlalchemy.engine.base.Engine SELECT c.relname FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace WHERE n.nspname = %(schema)s AND c.relkind in ('r', 'p')
2020-0[...]<jupyter_text>Load the tables based on foreign key relationship<jupyter_code>#Rental_craigslist.to_sql(name="Rental", con=engine, if_exists='append', index=False)
#crime_data.to_sql(name="Crime", con=engine, if_exists='append', index=False)
#bridge_table.to_sql(name="Bridge_Rental_Crime", con=engine, if_exists='append', index=False)
#bridge_table_kijiji.to_sql(name="Bridge_Rental_Crime", con=engine, if_exists='append', index=False)
#Rental_kijiji.to_sql(name="Rental", con=engine, if_exists='append', index=False)
#community_services_table.to_sql(name="Community_Assets", con=engine, if_exists='append', index=False)
#fsa_income_table.to_sql(name="Income", con=engine, if_exists='append', index=False)
a = "HI"
try:
    assert a==10
except:
    print("Hello")
a.capitalize()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16058394160583941, 'fraction_numerical': 0.0676841406768414, 'mean_word_length': 8.136363636363637, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '395878', 'license': 'MIT', 'n_tokens_mistral': 1295, 'n_tokens_neox': 1124, 'n_words': 173, 'path': 'Code/SQL_Load.ipynb', 'repo_name': 'McGlash/Toronto_Rental_Market_Project', 'size': '3014'}