Skip to content

BUG: Index shift drops index name #3986

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 21, 2013
Merged

BUG: Index shift drops index name #3986

merged 1 commit into from
Jun 21, 2013

Conversation

miketkelly
Copy link

>>> idx = pd.Index([pd.to_datetime('2013-06-21')], name='idx')
>>> idx.name
'idx'
>>> idx.shift(1, freq='B').name == None
True

@jreback
Copy link
Contributor

jreback commented Jun 21, 2013

looks good....

can you add a release notes mention (they are now in doc/source/release.rst) FYI
(since it doesn't have an issue, just put in the note, in the bug fix section)

thxs

@joeb1415
Copy link

Related?:

from pandas import Series, Index
s = Series(range(3), name='name')
Index(s).name

Returns None

@jreback
Copy link
Contributor

jreback commented Jun 21, 2013

@joeb1415

you have to pass it in the constructor, e.g.

Index(s,name=s.name)

it could be automatic, but not sure of a use case for this

@miketkelly
Copy link
Author

Release notes added.

hayd added a commit that referenced this pull request Jun 21, 2013
@hayd hayd merged commit 5123da8 into pandas-dev:master Jun 21, 2013
@hayd
Copy link
Contributor

hayd commented Jun 21, 2013

@mtkni Another pesky name bugs down, good work! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants