Skip to content

Conversation

amilbourne
Copy link
Contributor

This hopefully clarifies the documentation for the behaviour of the convert_dates and keep_default_dates parameters on the read_json function.

I recently had to use this function and found the existing docs a bit confusing. I actually created a truth table (below), but this is probably a bit much for the docs.

convert_dates keep_default_dates Result
True True Convert default date fields
True False Don’t convert anything
False True Don’t convert anything
False False Don’t convert anything
List True Convert listed and default date fields
List False Convert just listed date fields

I hope you agree that my changes make the behaviour clearer - but perhaps people will disagree...

@simonjayhawkins simonjayhawkins added Docs IO JSON read_json, to_json, json_normalize labels Jan 13, 2020
Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

minor comment otherwise lgtm

@WillAyd WillAyd added this to the 1.1 milestone Jan 14, 2020
@WillAyd WillAyd merged commit cb05c13 into pandas-dev:master Jan 14, 2020
@WillAyd
Copy link
Member

WillAyd commented Jan 14, 2020

Great thanks @amilbourne

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docs IO JSON read_json, to_json, json_normalize

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants