Skip to content

Commit

Permalink
ex5 completed
Browse files Browse the repository at this point in the history
  • Loading branch information
imbilalbutt committed Jan 24, 2024
1 parent 7889019 commit 76d72cf
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions exercises/exercise5.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,9 @@ def load_data_in_database(engine, table, dataframe):
stops_df = pd.read_csv("./output_dir/" + stops_filename, usecols=stops_columns, encoding='utf-8')

# Filtering data
stops_df = stops_df[stops_df["zone_id"] == 2001]

stops_df = stops_df[(stops_df['stop_lat'] >= -90) & (stops_df['stop_lat'] <= 90)]
stops_df = stops_df[(stops_df['stop_lon'] >= -90) & (stops_df['stop_lon'] <= 90)]

stops_df = stops_df.dropna(axis=0)

# stops_df = validate_dataframe(stops_df)
stops_df = validate_dataframe(stops_df)

engine = establish_connection(_database)
load_data_in_database(engine, _table, stops_df)


print("ETL -- Successfully completed.")

0 comments on commit 76d72cf

Please sign in to comment.