From c098bb1e20c8e1ef1f65c3c2b17c9ae97d8cd294 Mon Sep 17 00:00:00 2001 From: Ed Braaten Date: Sun, 1 Dec 2024 20:07:05 -0800 Subject: [PATCH] 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. --- DMR_Net_Check_In.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/DMR_Net_Check_In.py b/DMR_Net_Check_In.py index 5d8d480..e5c5caa 100644 --- a/DMR_Net_Check_In.py +++ b/DMR_Net_Check_In.py @@ -102,11 +102,11 @@ for i,row in hh_dir_df.iterrows(): hh_phone_dict.update({callsign : hh_num}) # fill in any missing data (NAN's) with default text -callinfo_df['Name'].fillna('', inplace=True) -callinfo_df['State'].fillna('none', inplace=True) -callinfo_df['District'].fillna('unknown', inplace=True) -callinfo_df['County'].fillna('unknown', inplace=True) -callinfo_df['Affiliation'].fillna('', inplace=True) +callinfo_df.fillna({'Name' : ''}, inplace=True) +callinfo_df.fillna({'State' : 'none'}, inplace=True) +callinfo_df.fillna({'District' : 'unknown'}, inplace=True) +callinfo_df.fillna({'County' : 'unknown'}, inplace=True) +callinfo_df.fillna({'Affiliation' : ''}, inplace=True) # build dictionary of calls indexed by check-in date calls_on_date_dict = {}