Skip to content

Commit

Permalink
Fixed error causing the creation of unnamed columns
Browse files Browse the repository at this point in the history
  • Loading branch information
CryogenicallyPreservedWombat committed Aug 14, 2020
1 parent 20e05f4 commit cf86ff5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source_scraping.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,8 @@ def load_province(province, start_date=None, end_date=datetime.today(), update_c

try:
province_df = pd.read_csv(_csv_path(province))
province_df = province_df.drop('Unnamed: 0', axis=1)
errant_columns = [col for col in province_df.columns if col not in _columns]
province_df = province_df.drop(errant_columns, axis=1)

start_length = len(province_df.index)

Expand Down Expand Up @@ -930,4 +931,4 @@ def load_all(start_date=None, end_date=datetime.today(), update_csv=False, verbo
province_dict = load_provinces(start_date=start_date, end_date=end_date, update_csv=update_csv, verbose=verbose)
full_df = pd.concat(province_dict.values(), ignore_index=True)

return full_df
return full_df

0 comments on commit cf86ff5

Please sign in to comment.