Skip to content

About "fillna()"...kind like a bug? #29048

Closed
@j-takurou

Description

@j-takurou

Actually I wanna replace NaN with "mode" value of the variable.
But the following code doesn't work.

# Your code here
a = df.Embarked.mode()
df.Embarked[df.Embarked.isna()].replace(a.values[0], inplace=True)
df.Embarked[df.Embarked.isna()]
>>>61     NaN
829    NaN
Name: Embarked, dtype: object

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions