Updated inplace method code to future proof it against Pandas 3.0
which won't allow the previous method since it will behave as a copy.
This commit is contained in:
parent
69b3beb1f5
commit
c098bb1e20
1 changed files with 5 additions and 5 deletions
|
|
@ -102,11 +102,11 @@ for i,row in hh_dir_df.iterrows():
|
||||||
hh_phone_dict.update({callsign : hh_num})
|
hh_phone_dict.update({callsign : hh_num})
|
||||||
|
|
||||||
# fill in any missing data (NAN's) with default text
|
# fill in any missing data (NAN's) with default text
|
||||||
callinfo_df['Name'].fillna('', inplace=True)
|
callinfo_df.fillna({'Name' : ''}, inplace=True)
|
||||||
callinfo_df['State'].fillna('none', inplace=True)
|
callinfo_df.fillna({'State' : 'none'}, inplace=True)
|
||||||
callinfo_df['District'].fillna('unknown', inplace=True)
|
callinfo_df.fillna({'District' : 'unknown'}, inplace=True)
|
||||||
callinfo_df['County'].fillna('unknown', inplace=True)
|
callinfo_df.fillna({'County' : 'unknown'}, inplace=True)
|
||||||
callinfo_df['Affiliation'].fillna('', inplace=True)
|
callinfo_df.fillna({'Affiliation' : ''}, inplace=True)
|
||||||
|
|
||||||
# build dictionary of calls indexed by check-in date
|
# build dictionary of calls indexed by check-in date
|
||||||
calls_on_date_dict = {}
|
calls_on_date_dict = {}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue