+1 vote
in Python by

You are given a dataframe with prices of cheeses. However, the dataframe is missing values in the price column. Write a function to impute the median price in place of missing values.

1 Answer

0 votes
by
This problem uses two built-in Pandas methods.

dataframe.column.median()

This returns the median of a column in a dataframe.

dataframe.column.fillna('value')

This applies value to all NaN values in a given column.

Related questions

+1 vote
asked Oct 28, 2022 in Python by SakshiSharma
0 votes
asked Feb 10, 2021 in Python by SakshiSharma
...