BUG: Interchange Column.null_count
is a NumPy scalar, not a builtin int
#47789
Labels
Column.null_count
is a NumPy scalar, not a builtin int
#47789
In
PandasColumn
used for the dataframe interchange protocol,null_count
returns the result ofSeries.sum()
, which defaults to returning a 0dndarray
of the default integer (specifically a NumPy scalar). This is opposed toint
, which is specified fornull_count
in the spec.Relevant code
pandas/pandas/core/exchange/column.py
Lines 180 to 184 in a7c5773
This doesn't seem to be affecting interchange thus far, so might be a low-prio or wont-fix situation. I'd just add these 0d array situations has often tripped up logic assuming a Python
int
on the Array API side of things, and indeed there's currently a similiar issue for vaex's interchange implementation in vaexio/vaex#2093.Using local build of
main
upstream.The text was updated successfully, but these errors were encountered: