train = train.columns.apply(lambda x : train.drop([x],axis=1) if train[x].var() <100)
if a certain columns's var is lower then n i want to drop that column.
let say column x's var is lower then 100 then I want to drop the column
train = train.columns.apply(lambda x : train.drop([x],axis=1) if train[x].var() <100)
if a certain columns's var is lower then n i want to drop that column.
let say column x's var is lower then 100 then I want to drop the column
In pandas we can do
df=df.loc[:,~df.var(axis=0).lt(100)].copy()