Df.fillna() throws error in streamlit

values = {‘director’: ‘unknown_director’, ‘cast’: ‘unknown_cast’, ‘country’: ‘unknown_country’, ‘date_added’: ‘unknown_date_added’, ‘rating’: ‘unknown_rating’, ‘duration’: 0}
df.fillna(value = values, inplace = True)
df.head(10)

This is the code I’ve used in the Jupyter Notebook, it works totally fine but on Streamlit it throws the following error.
ArrowInvalid: (‘cannot mix list and non-list, non-null values’, ‘Conversion failed for column director with type object’)
I’m running the app locally and it’s not deployed yet.

Actually that code raises NameError because df is undefined. After defining df the code works for me. But it is unlikely that I defined it the same way you did.

1 Like

Thank you so much.