Because in
check value of indices, it is gotcha:
df = pd.DataFrame({
'A': ['a','a','a','a','b','b','b','c','d'],
'C': list(range(10, 19))
})
print (df)
A C
0 a 10
1 a 11
2 a 12
3 a 13
4 b 14
5 b 15
6 b 16
7 c 17
8 d 18
print(7 in df["C"])
True
print(10 in df["C"])
False
And in column C
is no value 7
, so returned empty list:
print(df.index[df["C"] == 7].tolist())
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…