-
-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
BUG: fix PeriodConverter issue when given a list of integers (GH9012) #9050
Conversation
the perf diff was massive |
something like this
Though i don't think this is actually causing the bug, they return the same results AFAICT |
In this case they return the same (as it are periods), but not when you provide eg ints:
|
And the thing is, if it is a PeriodIndex, it is already special cased: https://github.com/pydata/pandas/blob/v0.15.1/pandas/tseries/converter.py#L116, so this will not impact perfomance. But, I think if you just do |
ok, so obviously need a test for that, I thing should be straightforward to fix. The thing is to avoid reinterpreting the freq when you already have a PeriodIndex. |
Maybe specifically check for an array of Periods?
This is the performance difference (that you fixed for the general time series plotting):
|
you prob can use because then a PeriodIndex would be excluded |
yes, but I don't think that is needed, because: PeriodIndex is already checked for in an |
ok then! |
ah, but |
really |
yeah, but I expected it to handle lists without having to convert it to array:
But in any case, not going to worry about that particular case for now |
ahh, ok, that makes sense then (it assuem ndarray ness) |
71418ea
to
879d6db
Compare
OK, updated the PR, no time now to further look at it, but will try to add tests later this evening |
ok, will try to do the release tonight in that case |
For example coming up when [0, 1] is passed by axhline Restore old behaviour, but special case arrays of Periods to keep the performance gain of using PeriodIndex instead of get_datevalue for that case.
879d6db
to
200f6fa
Compare
merged via b69b9d3 |
For example coming up when [0, 1] is passed by axhline
Closes #9012
test and whatsnew are coming