Skip to content Skip to sidebar Skip to footer

Typeerror: Only Integer Scalar Arrays Can Be Converted To A Scalar Index When Use Pandas Fillna

Update : It seems due to .loc ,if i uses the original df from pd.read_excel, it is fine. I have a dataframe with Dtypes as follows. This is csv for the dataframe : CSV File Date

Solution 1:

I think there are strings NaN in Currency and Id columns, so use:

df = df.replace({'Currency': {'NaN': '0'}, 'ID':{'NaN': '0'}})

Post a Comment for "Typeerror: Only Integer Scalar Arrays Can Be Converted To A Scalar Index When Use Pandas Fillna"