Skip to content

Commit

Permalink
Add exercise 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Nahrain1 committed Jan 26, 2024
1 parent 570c9e6 commit ad2f174
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions exercises/exercise5.py
Original file line number Diff line number Diff line change
@@ -15,11 +15,9 @@
df = pd.read_csv("stops.txt", usecols=stops_cols)
df = df[df['zone_id'] == 2001]


df = df.dropna(subset=['stop_name', 'stop_lat', 'stop_lon'])
df = df[(df['stop_lat'] >= -90) & (df['stop_lat'] <= 90)]
df = df[(df['stop_lon'] >= -90) & (df['stop_lon'] <= 90)]


engine = create_engine('sqlite:///gtfs.sqlite')
df.to_sql('stops', engine, if_exists='replace', index=False)

0 comments on commit ad2f174

Please sign in to comment.