Skip to content

BUG: Index removes name when sliced #4233

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
Jul 14, 2013
Merged

BUG: Index removes name when sliced #4233

merged 1 commit into from
Jul 14, 2013

Conversation

cpcloud
Copy link
Member

@cpcloud cpcloud commented Jul 13, 2013

closes #4226

@ghost ghost assigned cpcloud Jul 13, 2013
@jreback
Copy link
Contributor

jreback commented Jul 13, 2013

can u make sure no perf hit with a test_perf ?

@cpcloud
Copy link
Member Author

cpcloud commented Jul 13, 2013

running now

@jreback
Copy link
Contributor

jreback commented Jul 13, 2013

whenever I touch indexing I make sure to do that
seemingly innocuous changes sometimes have impact ( that said there IS some variation in perf stats so even a 15% reduction may not mean much and could change in retest)

@cpcloud
Copy link
Member Author

cpcloud commented Jul 13, 2013

good to know. seems like only a small constant will be added here since getslice just passes to getitem, but i'll be sure to do that whenever i touch indexing

@cpcloud
Copy link
Member Author

cpcloud commented Jul 13, 2013

i haven't really had time to play with test_perf.sh but is there a way to look at all test_perf.sh runs one has done? e.g., i could run overnight 1000 times and look at variability to get a reasonable estimate

@cpcloud
Copy link
Member Author

cpcloud commented Jul 13, 2013

well this is annoying

index_datetime_union                         |  51.5563 |  10.3513 |   4.9806 |
index_datetime_intersection                  |  51.4587 |  10.3063 |   4.9929 |
-------------------------------------------------------------------------------
Test name                                    | head[ms] | base[ms] |  ratio   |
-------------------------------------------------------------------------------

@cpcloud
Copy link
Member Author

cpcloud commented Jul 13, 2013

twice in a row it's been around ~5

@cpcloud
Copy link
Member Author

cpcloud commented Jul 13, 2013

@jreback what to do here...__getslice__ is defined by ndarray in C code so...gonna be a little hard to get around this.

@jreback
Copy link
Contributor

jreback commented Jul 13, 2013

array_finalize should set name (I thought it did)?
this is called on array creation after a numpy func

@cpcloud
Copy link
Member Author

cpcloud commented Jul 13, 2013

hm ok my fix looks unecessary, there's something weird in DatetimeIndex since __array_finalize__ is not being called

@cpcloud
Copy link
Member Author

cpcloud commented Jul 13, 2013

oh nvm i c. no name attr there nice, easy fix

@cpcloud
Copy link
Member Author

cpcloud commented Jul 13, 2013

perf back to fluctuating around 1.0! yay!

@cpcloud
Copy link
Member Author

cpcloud commented Jul 13, 2013

@jreback any more thoughts here?

Now index names are preserved through slicing
@jreback
Copy link
Contributor

jreback commented Jul 14, 2013

so this actuallly ends up being a trivial change....ok...merge away

cpcloud added a commit that referenced this pull request Jul 14, 2013
BUG: Index removes name when sliced
@cpcloud cpcloud merged commit 2b4a477 into pandas-dev:master Jul 14, 2013
@cpcloud cpcloud deleted the fix-index-slicing branch July 14, 2013 13:32
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.

API: DateTimeIndex slicing removes name label
2 participants