-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
"AssertionError: Index length did not match values" when resampling with kind='period' #3609
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
Comments
This is not supported. As you indicated you can resample then
I'll make this an enhancement/bug request, because it should raise a helpful message (or be implemented) thanks |
wow, thanks for the very swift response ;) |
I actually don't get an error here. It just hangs. |
@cpcloud can you post what you did? |
@jreback Yeah, sorry to hit and run like that :) dind = period_range('1/1/2001', '1/1/2002').to_timestamp()
s = Series(randn(dind.size), dind)
s.resample('T', kind='period') # hangs here The other ways of doing this (from above) work fine. Doesn't hang (throws the above error) for the simple case of dind = period_range('1/1/2001', '1/2/2001').to_timestamp()
s = Series(randn(dind.size), dind)
s.resample('T', kind='period') # hangs here and starts to hang for |
hmm...that might be something else
|
Yeah that works. |
should i open an issue for the above? seems to be a day frequency issue. |
yeh....(I put it in the header) so just ref this issue too |
@jreback i would like to clear this up since clearing it up would actually close 3 issues: this (#3609), #3612, and #3899. what's the original reason for not supporting this...my current fix loses the last element when resampling from datetimes to period so i'm guessing that might be one issue...but that's because of the ability to choose your resampling either include the start/end point of datetimes which periods don't have |
one issue that two element case is not handled |
now i'm getting a segfault when i try to use |
move back to 0.13 then? |
…cal timezone. Related to pandas-dev#5340. Signed-off-by: Kevin Stone <[email protected]> Added Test Case for pandas-dev#3609. Signed-off-by: Kevin Stone <[email protected]> Fixes Grouping by Period with Timezones The timestamp generated to partition the data frame doesn't include timezone information, so it was creating the wrong groups. It also had the frequency ('D') hard coded. Fixes pandas-dev#5340 and pandas-dev#3609. Signed-off-by: Kevin Stone <[email protected]>
Should raise that
kind='period'
is not accepted forDatetimeIndex
when resamplingPossible issue with period index resampling hanging (see @cpcloud example below)
version = 0.12.0.dev-f61d7e3
This bug also exists in 0.11.
The bug
A workaround / expected behaviour
More information
(Please let me know if you need more info! I'm using Ubuntu 13.04. It's entirely possible that this isn't a bug but instead I am doing something stupid. Oh, and let me take this opportunity to thank the Pandas dev team! Pandas is awesome!!! THANK YOU!)
The text was updated successfully, but these errors were encountered: