Skip to content

API: Improved inference of datetime/timedelta with mixed null objects. (GH7431) #7435

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

Merged
merged 2 commits into from
Jun 13, 2014

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Jun 11, 2014

  • regression from 0.13.1 in interpretation of an object Index
  • additional tests to validate datetimelike inferences

closes #7431

@jreback jreback added this to the 0.14.1 milestone Jun 11, 2014
jreback added 2 commits June 12, 2014 09:05
…. Regression from 0.13.1 in interpretation of an object Index with all null elements (GH7431)
@jreback
Copy link
Contributor Author

jreback commented Jun 12, 2014

@cpcloud @jorisvandenbossche have a look

this inference biz is pretty complicated; hopefully sightly less complicated now (issue is that you can easily mess up perf if you keep trying to infer object dtypes).

technically I did change one API here, in that

In 0.14.0

In [1]: from datetime import timedelta

In [2]: Series([timedelta(1)])
Out[2]: 
0   1 days
dtype: timedelta64[ns]

In [3]: DataFrame([timedelta(1)])
Out[3]: 
                0
0  1 day, 0:00:00

In [4]: DataFrame([timedelta(1)]).dtypes
Out[4]: 
0    object
dtype: object

Now

In [2]: DataFrame([timedelta(1)])
Out[2]: 
       0
0 1 days

In [3]: DataFrame([timedelta(1)]).dtypes
Out[3]: 
0    timedelta64[ns]
dtype: object

So was not tested before

jreback added a commit that referenced this pull request Jun 13, 2014
API: Improved inference of datetime/timedelta with mixed null objects. (GH7431)
@jreback jreback merged commit 818cf27 into pandas-dev:master Jun 13, 2014
@jorisvandenbossche
Copy link
Member

I can't comment on the code, but for the API change, it was indeed no problem to merge I think as it was actually more a bug that is fixed. And not one that too many people will rely upon I think, as eg with DataFrame({'A':[timedelta(1), timedelta(2)]}) it already did work as expected before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

series created with DatetimeIndex when index is [None]
2 participants