jorisvandenbossche commented on issue #44961:
URL: https://github.com/apache/arrow/issues/44961#issuecomment-2540848821
To my previous comment, I think you might misinterpret what `count` is
exactly doing, as it is not a scalar function, i.e. it is not counting the
values per element in the list array (so you can't use it to filter empty
_rows_).
If you call the function on the actual data (so it executes eagerly and not
through an expression);
```
In [28]: data = [["peanuts", "shellfish", "gluten"], ["dust", "pollen"],
["cats", "dogs", "feathers"], []]
...:
...: # Create a PyArrow array
...: allergies_array = pa.array(data, type=pa.list_(pa.string()))
In [29]: pc.count(allergies_array, mode="all")
Out[29]: <pyarrow.Int64Scalar: 4>
```
It counts that the full array has 4 elements (so kind of the length of the
array, except that by default it only counts the non-null values)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]