In a pandas dataframe, what is the quickest way to check if at least one element is 0? Imagine the data is :
Name   Asset  Revenue
A       10     20
B       0      21
I need to return true because at least one element is 0. One element across the dataframe, not one element per row/column
Maybe using any twice
df.eq(0).any().any()
Out[173]: True
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With