question archive There are a few missing values (NaN values) in the column 'depth' and they are to be filled with the average value of the column categorized by the cut of the diamond ('cut' column)
Subject:Computer SciencePrice: Bought3
There are a few missing values (NaN values) in the column 'depth' and they are to be filled with the average value of the column categorized by the cut of the diamond ('cut' column). Which of the following code snippets can be used to do the same?
Answer choices
Select only one option
data['depth'].fillna(value = data.groupby(['cut'])['depth'].transform('mean'))
data['cut'].fillna(value = data.groupby(['cut'])['depth'].transform('mean'))
data['depth'].fillna(value = data.groupby(['depth'])['cut'].transform('mean'))
data['depth'].fillna(value = data.groupby(['cut'])['cut'].transform('mean'))