Lets suppose I create a dataframe with columns and query i.e
pd.DataFrame([[1,2],[3,4],[5,6]],columns=['a','b']).query('a>1')
This will give me
a b
1 3 4
2 5 6
But when dataframe values are too large and I don't have column names, how can I query a column by its index?
I tried querying by passing a number, but it's not the way of doing it.
pd.DataFrame([[1,2],[3,4],[5,6]]).query('0>1') # This is what I tried.
How to denote 0
is the column name in query?
Expected Output:
0 1
1 3 4
2 5 6