My main Excel Sheet:- Excel Sheet My code:
from pathlib import Path
import pandas as pd
p = Path(r'/.')
df = pd.concat([pd.read_excel(f)
for f in p.rglob('test.xlsx')],
ignore_index=True)
df
df.to_excel("final.xlsx")
The output is:- My 'NA' strings get convert to NaN
and after converting the dataframe to excel all my NA sting to blank.
The solution to this was :- keep_default_na=False while reading the datasheet.