Skip to content
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: read_json returning Index instead of RangeIndex #57439

Merged
merged 3 commits into from Feb 21, 2024

Conversation

mroeschke
Copy link
Member

_convert_axes and _try_convert_data could both probably use a cleanup to align with pandas standard inference, but this is a minimal change for 2.2.1

@mroeschke mroeschke added IO JSON read_json, to_json, json_normalize Index Related to the Index class or subclasses labels Feb 15, 2024
@mroeschke mroeschke added this to the 2.2.1 milestone Feb 15, 2024
data = data.astype("float64")
except (TypeError, ValueError):
pass
if data.dtype.kind == "f" and data.dtype != "float64":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know where float32 values are coming from in the first place? I am surprised this is necessary

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same...I'm guessing this is just an overly safe check but just leaving this unchanged since this is a regression fix

@mroeschke mroeschke merged commit f6d7d99 into pandas-dev:main Feb 21, 2024
47 checks passed
@mroeschke mroeschke deleted the bug/read_json/rngidx branch February 21, 2024 19:41
meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Feb 21, 2024
mroeschke added a commit that referenced this pull request Feb 21, 2024
…stead of RangeIndex) (#57552)

Backport PR #57439: BUG: read_json returning Index instead of RangeIndex

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
* BUG: read_json returning Index instead of RangeIndex

* Keep track of conversion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Index Related to the Index class or subclasses IO JSON read_json, to_json, json_normalize
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: read_json(line=True) returns Index instead of RangeIndex in 2.2
2 participants