Skip to content

BUG: periodindex converted to Series incorrectly getting coerce to int64 #7932

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

Closed
jreback opened this issue Aug 4, 2014 · 0 comments · Fixed by #8237
Closed

BUG: periodindex converted to Series incorrectly getting coerce to int64 #7932

jreback opened this issue Aug 4, 2014 · 0 comments · Fixed by #8237
Labels
Bug Period Period data type
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Aug 4, 2014

In [47]: span
Out[47]: 
<class 'pandas.tseries.period.PeriodIndex'>
[2012-12-31, ..., 9999-12-31]
Length: 3, Freq: D

In [48]: Series(span)
Out[48]: 
0      15705
1      16404
2    2932896
dtype: int64

In [49]: Series(span.asobject)
Out[49]: 
0    2012-12-31
1    2014-11-30
2    9999-12-31
dtype: object

I believe this works correctly if its a setitem in a frame, e.g.

df['span'] = span but not in the Series constructor, needs this: https://github.com/pydata/pandas/blob/master/pandas/core/series.py#L2436 called in the Series.__init__

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Period Period data type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant