I want to remove a certain columns based on high null values. In few columns there is a value(in this case "Select) which is equivalent to null. I want to replace this with null so that i can calculate the null % and removes columns accordingly.
Lead Profile City
Select Select
Select Select
Potential Lead Mumbai
Select Mumbai
Select Mumbai
Tried using replace function as well as map function.
leads['Specialization'] = leads['Specialization'].replace('Select', "NaN")
This Code just replaces the string with string and doesnt actually impute null values
def colmap(x):
return x.map({"Select": "Nan"})
df[['Lead Profile']] = df[['Lead Profile']].apply(colmap)
This code replaces all the values with NAN
numpyanddf.replace('Select', np.nan)import numpy as npstatement.