![]() |
VOOZH | about |
Dataset is a collection of attributes and rows. Data set can have missing data that are represented by NA in Python and in this article, we are going to replace missing values in this article
We consider this data set: Dataset
In our data contains missing values in quantity, price, bought, forenoon and afternoon columns,
So, We can replace missing values in the quantity column with mean, price column with a median, Bought column with standard deviation. Forenoon column with the minimum value in that column. Afternoon column with maximum value in that column.
Approach:
Syntax:
Mean: data=data.fillna(data.mean())
Median: data=data.fillna(data.median())
Standard Deviation: data=data.fillna(data.std())
Min: data=data.fillna(data.min())
Max: data=data.fillna(data.max())
Below is the Implementation:
Output:
👁 ImageThen after we will proceed with Replacing missing values with mean, median, mode, standard deviation, min & max