For example:
I need to replace the NaN values for rows under HomePlanet column with the most frequent entries in the other rows (in this case it would be Earth). How can I go about executing this?
Is this what you are looking for (assuming your dataframe is named 'df')?
df["HomePlanet"].fillna("Earth", inplace = True)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.