You can check which elements are zeros with df == 0
. Then you can apply the .any
across axis
1
in order to see which rows have any column equal to 0
:
(df == 0).any(axis=1)
If you want to get the row indexes for all elements where that is true, you can do something like this:
df[(df == 0).any(axis=1)].index
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…