-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Partial indexing only valid for ordered time series #2437
Comments
Now I think about it: it's not clear how to pick a Timestamp from a date unless they are ordered! Which explains this behaviour... In the ordered case the first result which satisfies the partial date is selected. In the unordered case returning sometimes returning a series would be confusing, and picking a "closest" wouldn't really make sense. |
I respectfully disagree with aspects of this behavior as it stands. For example: whenever a user specifies a range of dates (in one of the several ways possible to do this), they can expect (quite reasonably) to receive a list of entries from an ordered time series. What's wrong with implementing this same behavior on an unordered series? Right now, for an unordered series, you get an error if you try to specify a date range. This can be fixed without impacting the question of which entry should be "first" . This may not fly with you guys, but I'd even take it one step further. If a user specifies a single date as an index, they should receive all entries with the matching date. It's better behavior, because its consistent: if you ask for a month, you get the whole month; a year, you get the whole year; what's so special about a day that the behavior should suddenly change? |
@jbrdly that's a convincing argument (at least, you've convinced me). In fact, this also seems inconsistent when you compare to the behaviour of Series:
|
I guess the error message should read "not yet supported". Would be nice to fix this in the future |
@hayd this is all fixed up, note that the stamps will be returned in the same order as the index of the series (which makes sense) |
This was mentioned on StackOverflow, I thought I ought to post it here. I'm not sure whether or not this is a bug:
You can select by a date string in an ordered tseries, but not in an ordered one:
The text was updated successfully, but these errors were encountered: