Skip to main content
Post Closed as "Duplicate" by BeRT2me, Mark Rotteveel, Michael Mintz
deleted 1 character in body
Source Link
Puj
  • 13
  • 4

I have a dataset with missing values, I determined the best way to approach this problem is to find the median of the row and replace the NaN values with the median value. However, the code runs but values are notenot replaced.

medianinf= inflation_data.iloc[:, 4:-1].median(axis=1) filledinfdata= inflation_data.replace(to_replace= np.nan, value= medianinf) 
medianinf= inflation_data.iloc[:, 4:-1].median(axis=1) filled_inf_data=inflation_data.fillna(medianinf) 

I tried both of these code, a median value is produced of each row but the Nan Values in the dataset are not getting replaced

I have a dataset with missing values, I determined the best way to approach this problem is to find the median of the row and replace the NaN values with the median value. However, the code runs but values are note replaced.

medianinf= inflation_data.iloc[:, 4:-1].median(axis=1) filledinfdata= inflation_data.replace(to_replace= np.nan, value= medianinf) 
medianinf= inflation_data.iloc[:, 4:-1].median(axis=1) filled_inf_data=inflation_data.fillna(medianinf) 

I tried both of these code, a median value is produced of each row but the Nan Values in the dataset are not getting replaced

I have a dataset with missing values, I determined the best way to approach this problem is to find the median of the row and replace the NaN values with the median value. However, the code runs but values are not replaced.

medianinf= inflation_data.iloc[:, 4:-1].median(axis=1) filledinfdata= inflation_data.replace(to_replace= np.nan, value= medianinf) 
medianinf= inflation_data.iloc[:, 4:-1].median(axis=1) filled_inf_data=inflation_data.fillna(medianinf) 

I tried both of these code, a median value is produced of each row but the Nan Values in the dataset are not getting replaced

edited tags
Source Link
BigBen
  • 50.4k
  • 7
  • 29
  • 45

I have a dataset with missing values, I determined the best way to approach this problem is to find the median of the row and replace the NaN values with the median value. However, the code runs but values are note replaced.

`medianinf= inflation_data.iloc[:, 4:-1].median(axis=1) filledinfdata= inflation_data.replace(to_replace= np.nan, value= medianinf)'

medianinf= inflation_data.iloc[:, 4:-1].median(axis=1) filledinfdata= inflation_data.replace(to_replace= np.nan, value= medianinf) 

'medianinf= inflation_data.iloc[:, 4:-1].median(axis=1) filled_inf_data=inflation_data.fillna(medianinf)`

medianinf= inflation_data.iloc[:, 4:-1].median(axis=1) filled_inf_data=inflation_data.fillna(medianinf) 

I tried both of these code, a median value is produced of each row but the Nan Values in the dataset are not getting replaced

I have a dataset with missing values, I determined the best way to approach this problem is to find the median of the row and replace the NaN values with the median value. However, the code runs but values are note replaced.

`medianinf= inflation_data.iloc[:, 4:-1].median(axis=1) filledinfdata= inflation_data.replace(to_replace= np.nan, value= medianinf)'

'medianinf= inflation_data.iloc[:, 4:-1].median(axis=1) filled_inf_data=inflation_data.fillna(medianinf)`

I tried both of these code, a median value is produced of each row but the Nan Values in the dataset are not getting replaced

I have a dataset with missing values, I determined the best way to approach this problem is to find the median of the row and replace the NaN values with the median value. However, the code runs but values are note replaced.

medianinf= inflation_data.iloc[:, 4:-1].median(axis=1) filledinfdata= inflation_data.replace(to_replace= np.nan, value= medianinf) 
medianinf= inflation_data.iloc[:, 4:-1].median(axis=1) filled_inf_data=inflation_data.fillna(medianinf) 

I tried both of these code, a median value is produced of each row but the Nan Values in the dataset are not getting replaced

Source Link
Puj
  • 13
  • 4

How to replace NaN values with the median in the dataset

I have a dataset with missing values, I determined the best way to approach this problem is to find the median of the row and replace the NaN values with the median value. However, the code runs but values are note replaced.

`medianinf= inflation_data.iloc[:, 4:-1].median(axis=1) filledinfdata= inflation_data.replace(to_replace= np.nan, value= medianinf)'

'medianinf= inflation_data.iloc[:, 4:-1].median(axis=1) filled_inf_data=inflation_data.fillna(medianinf)`

I tried both of these code, a median value is produced of each row but the Nan Values in the dataset are not getting replaced