Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
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. |
ghost
commented
Dec 9, 2012
|
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 |
jreback
referenced
this issue
Mar 22, 2013
Closed
ENH: extend selection semantics on ordered timeseries to unordered #3133
|
@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) |
hayd commentedDec 6, 2012
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: