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

JSON: handling missing values in date coercion #10747

Closed
jreback opened this issue Aug 4, 2015 · 1 comment
Closed

JSON: handling missing values in date coercion #10747

jreback opened this issue Aug 4, 2015 · 1 comment
Labels
Bug Datetime Datetime data dtype IO JSON read_json, to_json, json_normalize
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Aug 4, 2015

xref #10746

In [1]: data = '''
   ...: [{"id": 1, "timestamp": 1036713600000},
   ...:  {"id": 2}]
   ...: '''

after #10776 this is ok

In [2]: pd.read_json(StringIO(data), orient='records', dtype={'id': 'int32', 'timestamp': 'datetime64[ms]'})
Out[2]: 
   id     timestamp
0   1  1.036714e+12
1   2           NaN

In [2]: pd.read_json(StringIO(data), orient='records', dtype={'id': 'int32', 'timestamp': 'datetime64[ms]'})
Out[10]: 
   id  timestamp
0   1 2002-11-08
1   2        NaT

still open

In [7]: pd.read_json(StringIO(data), orient='records', date_unit='ms')
Out[7]: 
   id     timestamp
0   1  1.036714e+12
1   2           NaN
@jreback jreback added Bug Datetime Datetime data dtype IO JSON read_json, to_json, json_normalize Difficulty Intermediate labels Aug 4, 2015
@jreback jreback added this to the Next Major Release milestone Aug 4, 2015
@jreback jreback modified the milestones: 0.17.0, Next Major Release Aug 21, 2015
@jreback
Copy link
Contributor Author

jreback commented Aug 24, 2015

closed by #10876

@jreback jreback closed this as completed Aug 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype IO JSON read_json, to_json, json_normalize
Projects
None yet
Development

No branches or pull requests

1 participant