Skip to content

Commit

Permalink
fixed broken csv parsing for 2014 due to emptry strings
Browse files Browse the repository at this point in the history
  • Loading branch information
sehoffmann committed Aug 24, 2023
1 parent 864fe68 commit 51ff23d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions folktables/load_acs.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ def load_acs(root_dir, states=None, year=2018, horizon='1-Year',
initialize_and_download(base_datadir, state, year, horizon, survey, download=download)
)

dtypes = {'PINCP': np.float64, 'RT': str, 'SOCP': str, 'SERIALNO': str, 'NAICSP': str}
df_list = []
for file_name in file_names:
df = pd.read_csv(file_name, dtype=dtypes).replace(' ','')
dtype = {'RT': str, 'SOCP': str, 'SERIALNO': str, 'NAICSP': str}
df = pd.read_csv(file_name, na_values=[' '], dtype=dtype).replace(' ','')
if serial_filter_list is not None:
df = df[df['SERIALNO'].isin(serial_filter_list)]
df_list.append(df)
Expand Down

0 comments on commit 51ff23d

Please sign in to comment.