-
-
Notifications
You must be signed in to change notification settings - Fork 315
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
Added pandas and JSON normalization code #2968
Merged
Merged
Changes from 10 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
6713950
added json normalization code
IamEzio 86b4c96
Merge branch 'centerofci:develop' into json-normalize
IamEzio 2566d90
created json_parsing dir
IamEzio 62bf8cd
added validation while creating datafile
IamEzio 27386ea
nit
IamEzio c991229
nit
IamEzio 39b378a
added default msg in exceptions
IamEzio 2cf344f
fixed failing tests
IamEzio 45d5218
added docstring
IamEzio f19fbd1
Merge branch 'develop' into json-normalize
dmos62 ca6d5ee
explained json normalization algo
IamEzio 8266039
merged from master
IamEzio 8a3d900
Merge branch 'develop' into json-normalize
dmos62 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[ | ||
{ | ||
"first_name":"Matt", | ||
"last_name":"Murdock", | ||
"gender":"Male", | ||
"friends": ["Stick", "Foggy"], | ||
"address": { | ||
"street": "210", | ||
"city": "NY" | ||
} | ||
}, | ||
{ | ||
"first_name":"John", | ||
"last_name":"Doe", | ||
"email":"jd@example.org", | ||
"gender":"Male", | ||
"friends": ["Mark", "Bill"] | ||
}, | ||
{ | ||
"first_name":"Frank", | ||
"last_name":"Castle", | ||
"email":"fc@example.org", | ||
"address": { | ||
"street": "211", | ||
"city": "NY" | ||
} | ||
} | ||
] | ||
|
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
Oops, something went wrong.
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.
Add a docstring. Include explanation for why
column_names
is necessary. Include explanation for why and howjson_normalize
is being invoked (what'smax_level
and why is it0
). Include explanation of the general algorithm and intent.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.
Done. Thanks!
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.
Include a summary and explation of the algorithm. You normalize into a dataframe, then convert to a JSON string, then to Python, ending up with a sequence of rows where each row is dict-like, in which every key-value pair is a column, then you take those columns and if they are a dict or a list, you serialize them back into JSON. That takes some time to figure out and the reason for having to do some of these things is not necessarily immediately obvious. Help the reader out with a summary and an explanation.
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.
Presume that the reader is not me or anyone that you've discussed JSON importing with.
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.
Hi Dom, I have added the explanation now. PTAL. Thanks!
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.
Awesome!