Suppose I have the following dataframe:
a b c d
0 0.049531 0.408824 0.975756 0.658347
1 0.981644 0.520834 0.258911 0.639664
2 0.641042 0.534873 0.806442 0.066625
3 0.764057 0.063252 0.256748 0.045850
and I want only the subset of columns whose value in row 0 is creater than 0.5. I can do this:
df2 = df.T
myResult = df2[df2.iloc[:, 0] > 0.5].T
But this feels like a horrible hack. Is there a nicer way to do boolean indexing along columns? Somewhere I can specify an axis argument?