Skip to content

Loosing series names, when concatenating into DataFrame #2489

@gbakalian

Description

@gbakalian

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


Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions