I am trying to remove nan values from a final csv file, which will source data for digital signage.
I use fillna to remove empty data to keep 'nan' from appearing on the sign. fillna is working, but because this data is formatted, I get ()-
in the empty csv fields.
df = pd.read_csv(filename)
df = df.fillna('')
df = df.astype(str)
df['PhoneNumber']=df['CONTACT PHONE NUMBER'].apply(lambda x: '('+x[:3]+')'+x[3:6]+'-'+x[6:10])
I tried writing an if...else
statement to separate lines in the array; but since the formatting is applied to the entire list, not entry by entry, that doesn't work.