Skip to content

BUG: SparseSeries constructor ignores input data name #10258

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

Merged
merged 1 commit into from
Jun 3, 2015

Conversation

sinhrks
Copy link
Member

@sinhrks sinhrks commented Jun 3, 2015

When constructing Series from Series, name attribute is preserved otherwise specified.

import pandas as pd
s = pd.Series([1, 2, 3], name='a')
pd.Series(s)
#0    1
#1    2
#2    3
# Name: a, dtype: int64

pd.Series(s, name='x')
#0    1
#1    2
#2    3
# Name: x, dtype: int64

But SparseSeries doesn't preserve its name.

s = pd.SparseSeries([1, 2, 3], name='a')
pd.SparseSeries(s)
#0    1
#1    2
#2    3
# dtype: int64
# BlockIndex
# Block locations: array([0], dtype=int32)
# Block lengths: array([3], dtype=int32)

@sinhrks sinhrks force-pushed the sparseconst_name branch from 9de503a to e1e364e Compare June 3, 2015 12:08
@jreback jreback added Bug Sparse Sparse Data Type labels Jun 3, 2015
@jreback jreback added this to the 0.16.2 milestone Jun 3, 2015
@jreback
Copy link
Contributor

jreback commented Jun 3, 2015

lgtm, merge when green.

sinhrks added a commit that referenced this pull request Jun 3, 2015
BUG: SparseSeries constructor ignores input data name
@sinhrks sinhrks merged commit efc4a08 into pandas-dev:master Jun 3, 2015
@sinhrks
Copy link
Member Author

sinhrks commented Jun 3, 2015

Thanks for review.

@sinhrks sinhrks deleted the sparseconst_name branch June 4, 2015 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Sparse Sparse Data Type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants