0

I have the need of using any() method of the data frame. This used to return the first non-empty value in the series but now it returns only true/false value.

>>> df = pd.DataFrame([{"a":"asdfads10", "b":100}, {"a":"10asdfasdf","b":200}])
>>> df['a'].any()
True

Can you help if you have seen any alternative?

  • Do you want the first row where `a` is not null? – Corralien Jun 06 '22 at 12:12
  • Maybe this is what you need? https://stackoverflow.com/questions/42137529/pandas-find-first-non-null-value-in-column – Gejun Jun 06 '22 at 12:15
  • 1
    Does this answer your question? [Pandas - find first non-null value in column](https://stackoverflow.com/questions/42137529/pandas-find-first-non-null-value-in-column) – Ynjxsjmh Jun 06 '22 at 13:48

0 Answers0