I am reading a csv file and performing some operation on the data and write data back to csv file While reading the data the "N/A" values converted as NaN
data in my csv file is:
My Pandas code is:
for df in pd.read_csv(filename, dtype='str', sep='|'):
print(df)
df.to_csv(filetar, sep='|', index=False, encoding='utf-8')
df data is as below:
while writing the data using to a file using to_csv the Value "NaN" didn't write either N/A.
Basically N/A converted NaN further Blank while writing CSV File.
I write write the data as N/A just like the source file. Any help on this.