Reputation: 20242
I have the following code:
raw_data = [[1, 2, 3], [4, 5, 6]]
df = pd.DataFrame(data=raw_data,
columns=["cA", "cB", "cC"])
wrong_indexes = df.loc[df['cA'] > 2 ]
print(wrong_indexes)
This prints:
cA cB cC
1 4 5 6
Instead of this, I would like to only get a list of indexes at which this condition holds, like so:
[1]
Any idea how I can do that?
Upvotes: 1
Views: 32