jorisvandenbossche commented on issue #14759:
URL: https://github.com/apache/arrow/issues/14759#issuecomment-1330303622
Ah, that seems to be because it's not a Series of lists, but of arrays:
```
In [9]: s.values
Out[9]:
array([array([array([1, 2, 3]), array([4])], dtype=object), None],
dtype=object)
```
So if calling `equals` with two Series with list elements doesn't trigger
the warning:
```
In [6]: s1 = pd.Series([[[1, 2, 3], [4]], None], dtype=object)
In [7]: s2 = pd.Series([[[1, 2, 3], [4]], None], dtype=object)
In [8]: s1.equals(s2)
Out[8]: True
```
but with one using arrays as elements, you see it:
```
In [10]: s1 = pd.Series([np.array([[1, 2, 3], [4]], dtype=object), None],
dtype=object)
In [11]: s1.equals(s2)
/home/joris/miniconda3/envs/arrow-dev/lib/python3.10/site-packages/pandas/core/dtypes/missing.py:575:
VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences
(which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths
or shapes) is deprecated. If you meant to do this, you must specify
'dtype=object' when creating the ndarray.
return lib.array_equivalent_object(
Out[11]: False
```
So that's a pandas "bug" in the `equals` method. Now, this warning was just
turned into an error in the recently release numpy 1.24, so I don't know if
that is still worth fixing for pandas.
(in any case we can just ignore that warning for our test suite, since it is
strictly coming from pandas)
--
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]