-
-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG/COMPAT: assert_* functions failing with nested arrays and latest numpy #50360
Comments
I suppose this is related to https://numpy.org/devdocs/release/1.25.0-notes.html#and-warnings-finalized (numpy/numpy#22707 Previously, such comparisons (incorrectly) returned a scalar bool:
and now with that deprecation enforced, this raises an error:
|
…assert-nested-data-numpy-125
It also fails for unit tests: import pandas as pd
import unittest
class list_test(unittest.TestCase):
def test_list_test(self):
list_of_lists = [[1,2,3], [4,5], [6]]
list_series = pd.Series(list_of_lists)
self.assertEqual(list_series.array, list_of_lists) This results in True with: And fails with a ValueError with: The error |
removing this from the 2.0 milestone |
When using the latest nightly numpy (1.25.0.dev0+..), we are getting some errors in the pyarrow test suite, that come from pandas functions (
assert_series_equal
, ->array_equivalent
). Those errors don't happen with numpy 1.24.A few examples that we encountered in the pyarrow tests seem all to boil down to the situation where you have multiple levels of nesting (an array of arrays of arrays), but where the one is a numpy array of nested numpy arrays, and the other is a numpy array of nested lists.
Another example, that is essentially the same situation, but that gives a different error message (from numpy):
Another case with nesting of dictionaries (with the same error traceback):
The text was updated successfully, but these errors were encountered: