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

concat() drops index when used on series with a PeriodIndex #1815

Closed
jmloser opened this issue Aug 27, 2012 · 1 comment

Comments

@jmloser
Copy link

commented Aug 27, 2012

New to this, sorry if I'm just missing something...

import numpy as np
import pandas as pd

d1 = pd.date_range('12/31/1990', '12/31/1999', freq='A-DEC')
d2 = pd.date_range('12/31/2000', '12/31/2009', freq='A-DEC')

s1 = pd.Series(np.random.randn(10), d1)
s2 = pd.Series(np.random.randn(10), d2)

# works
pd.concat([s1,s2])

s1 = s1.to_period()
s2 = s2.to_period()

# drops index
pd.concat([s1,s2])

# workaround
pd.concat([s1.to_timestamp(), s2.to_timestamp()]).to_period('A-DEC')

@wesm wesm closed this in f953727 Sep 10, 2012

@wesm

This comment has been minimized.

Copy link
Member

commented Sep 10, 2012

Nope. This is a bug-- just pushed a fix. Thanks for the report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.