filter columns where index value is 0
Question:
Answers:
Use DataFrame.loc
in boolean indexing
– first select index std
, compare and select all rows by :
with filtered mask:
df1 = df.loc[:, df.loc['std'].eq(0)]
You can filter the std
column for values that are equal to zero.
This could work: df = num_df.loc[num_df['std'] == 0]
Use DataFrame.loc
in boolean indexing
– first select index std
, compare and select all rows by :
with filtered mask:
df1 = df.loc[:, df.loc['std'].eq(0)]
You can filter the std
column for values that are equal to zero.
This could work: df = num_df.loc[num_df['std'] == 0]