-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DEPR: Deprecate numpy argument in read_json #28512
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
Comments
Should also note there are not tests that I can see that actually test |
Hi, I'd like to work on this one. What would be the best way to go? Removing the argument from the function and adding a deprecation warning to the next release notes? |
You should be able to apply the pandas/pandas/util/_decorators.py Line 104 in bd8dbf9
And then update tests in pandas.tests.io.json . Right now this argument is used for parametrization but doesn't actually change anything, so could probably just remove parametrization |
Don't remove the argument yet though just add warning |
According to user_guide/io.rst there are also some performance considerations. Are we still good to deprecate do you think?
randfloats = np.random.uniform(-100, 1000, 10000)
randfloats.shape = (1000, 10)
dffloats = pd.DataFrame(randfloats, columns=list('ABCDEFGHIJ'))
jsonfloats = dffloats.to_json()
pd.read_json(jsonfloats)
pd.read_json(jsonfloats, numpy=True) |
Yea should still deprecate |
I've never really been clear on the purpose of the
numpy
argument in to_json. Some digging brought me here #3876 (comment) where it is explained that this maintains some kind of sequence to elements. To illustrate the only difference I could findI might be missing the point but I don't understand why this would be useful. Objects in JSON are by definition not ordered, so this is non-compliant and I think just plain confusing.
So I think good to deprecate unless anyone has objections.
The text was updated successfully, but these errors were encountered: