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

Loosing series names, when concatenating into DataFrame #2489

Closed
gbakalian opened this Issue Dec 11, 2012 · 1 comment

Comments

Projects
None yet
2 participants
@gbakalian

gbakalian commented Dec 11, 2012

In the version 9.1, when we are concatenating pandas.Series, we would expect the columns name of the created DataFrame to be the ones of the Series which were concatenated together. Nevertheless the series' names are lost, and the columns are simply 0, 1, 2 ...

Error shown below:

pd.__version__
Out[14]: '0.9.1rc1'

s1 = pd.TimeSeries(randn(5), index=pd.date_range('01-Jan-2013', periods=5, freq='D'), name='A')

s2 = pd.TimeSeries(randn(5), index=pd.date_range('01-Jan-2013', periods=5, freq='D'), name='B')

series = [s1, s2]

pd.concat(series, axis=1)



_32.columns = map(lambda s: s.name, series)

_32



@wesm

This comment has been minimized.

Show comment
Hide comment
@wesm

wesm Dec 12, 2012

Member

I thought this worked. Marked as bug to investigate

Member

wesm commented Dec 12, 2012

I thought this worked. Marked as bug to investigate

@ghost ghost assigned wesm Dec 14, 2012

@wesm wesm closed this in 90cddee Dec 14, 2012

yarikoptic added a commit to neurodebian/pandas that referenced this issue Dec 20, 2012

Merge commit 'v0.10.0b1-65-g6cadd6c' into debian
* commit 'v0.10.0b1-65-g6cadd6c':
  BUG: workaround numpy issue in 1.6.2 on certain distros
  BUG: use "for" as keyword to test against
  ENH: option names must valid, non-keyword python identifiers
  TST: option names must valid, non-keyword python identifiers
  BUG: make sure pd.options style access triggers warnings and callbacks as needed
  ENH: provide attribute style access to options via pd.options
  REF: rename option key "print" to "display"
  BUG: use Series name attributes for colnames in concat with axis=1. close pandas-dev#2489
  ENH: add max_cols as keyword in DataFrame.info pandas-dev#2524
  BUG: allow users to set the max number of columns before per column info is hidden away pandas-dev#2524
  BUG: DataFrame.from_dict does not work with dict of sequence and orient=index pandas-dev#2496
  ENH: df.select uses bool(crit(x)) rather then crit(x)
  DOC: add FAQ section on monkey-patching
  BUG: diff should cast n to int pandas-dev#2523
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment