I know how to filter a dataframe by column value:
import pandas as pd
import numpy as np
from numpy.random import randn
np.random.seed(101)
df = pd.DataFrame(randn(5,4),index='A B C D E'.split(),columns='W X Y Z'.split())
print(df)
# show only rows where 'W' is positive
# here, the row for 'C' will be deleted, since df['W']['C']<0
df[df['W']>0]
But how do I filter by row value, e.g. 'B'>0?
Since df['X']['B']<=0 and df['Y']['B']<=0, I would like to delete columns X and Y. I tried the following code, but it reports an error:
df.loc[df.loc['B']>0]