I was wondering how I can remove all indexes that containing negative values inside their column. I am using Pandas DataFrames.
DataFrames
Documentation Pandas DataFr
If you want to check the values of an adjacent group of columns, for example from the second to the tenth:
df[(df.ix[:,2:10] > 0).all(1)]
You can also use a range
df[(df.ix[:,range(1,10,3)] > 0).all(1)]
and an own list of indices
mylist=[1,2,4,8] df[(df.ix[:, mylist] > 0).all(1)]