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:
Ed Braaten 2024-12-01 20:07:05 -08:00
parent 69b3beb1f5
commit c098bb1e20
No known key found for this signature in database
GPG key ID: 11743CE9834B8FA6

View file

@ -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 = {}