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

Loss of series name attributes in pd.concat #10698

Closed
multiloc opened this issue Jul 29, 2015 · 4 comments · Fixed by #10723
Closed

Loss of series name attributes in pd.concat #10698

multiloc opened this issue Jul 29, 2015 · 4 comments · Fixed by #10723
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Milestone

Comments

@multiloc
Copy link
Contributor

pd.concat nicely preserves name attributes when given a list of series. However, this only works if all series have the name attribute set, otherwise all names are lost:

In [1]: import pandas as pd
In [2]: pd.__version__
Out[2]: '0.16.2'

In [3]: foo = pd.Series([1,2], name='foo')
In [4]: bar = pd.Series([1,2])

In [6]: pd.concat([foo, bar], 1)
Out[6]: 
   0  1
0  1  1
1  2  2

Not sure this qualifies as a bug.

@jreback
Copy link
Contributor

jreback commented Jul 30, 2015

hmm, so you want

In [14]: DataFrame({'foo' : [1,2], 1 : [1,2]},columns=['foo',1])
Out[14]: 
   foo  1
0    1  1
1    2  2

seems reasonable. I'll mark it as a bug. pull-requests welcome!

@jreback jreback added Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode Difficulty Novice labels Jul 30, 2015
@jreback jreback added this to the Next Major Release milestone Jul 30, 2015
@multiloc
Copy link
Contributor Author

yep, that's it.

@jreback
Copy link
Contributor

jreback commented Jul 30, 2015

gr8. pull-requests welcome!

@jreback jreback modified the milestones: 0.17.0, Next Major Release Aug 2, 2015
@IamGianluca
Copy link

@jreback Do you have any comment on the last pull request? I fixed all unit tests which were previously failing.

jreback added a commit that referenced this issue Sep 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants