-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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: json_normalize raises boardcasting error with list-like metadata #47708
Closed
Closed
Changes from 17 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
039a659
fix repeat axis
GYHHAHA 1645550
add tests
GYHHAHA 6db3e6c
Update v1.5.0.rst
GYHHAHA 49f2950
change tests dtype descriptions
GYHHAHA b73d0f1
Merge branch 'main' into patch-1
GYHHAHA 8eb1421
drop np array
GYHHAHA de21683
Update _normalize.py
GYHHAHA 5a3d8bd
Update test_normalize.py
GYHHAHA a4ac5ec
Merge branch 'pandas-dev:main' into patch-1
GYHHAHA cc00c3e
fix dtype
GYHHAHA 7efe709
Update pandas/io/json/_normalize.py
GYHHAHA 9ad3db4
type ignore
GYHHAHA 23c090e
fix format
GYHHAHA b3d500f
remove object type
GYHHAHA 2779bc2
remove astype
GYHHAHA 6252821
fix format
GYHHAHA 34a3ace
import is_list_like
GYHHAHA f2fea4e
Update _normalize.py
GYHHAHA 06d9f34
Update test_normalize.py
GYHHAHA 35a8494
fix format
GYHHAHA 8135fea
Update _normalize.py
GYHHAHA fccfbba
Merge branch 'main' into patch-1
GYHHAHA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an alternative can we not just do something like:
Less than ideal but I think still gets us to the same place? The branching now is a little tough to follow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mroeschke suggested not to construct the np array for nested data, what I wrote before is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @WillAyd's suggestion is good if it works. My main issue before was one path calling
tolist()
and the other returning annp.ndarray
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Late response. Unfortunately this won't work. When v is a
list
,arr
will be[list(...)]
, which raises boardcasting error. Classified discussions may still be necessary. (Now both paths returnlist
for consistency and auto-type-infering.) @mroeschke