Skip to content

BUG: selection from unordered time-series has incorrect / odd behavior #3448

Closed
@jreback

Description

@jreback

original mods made < 0.11 in #3136 / #2437

incorrect selections, depending on the start:end pos gettting weird values

also should be able to select a value that's bigger/smaller than the contained range and have it work (this is how ordered series works)

[21]: s = Series(randn(10),date_range('20130101',periods=10))

In [22]: x = s.index.values

In [23]: random.shuffle(x)

In [24]: s.index = x

In [25]: s
Out[25]: 
2013-01-09    0.911882
2013-01-06   -0.310166
2013-01-10    1.090196
2013-01-07   -0.846249
2013-01-02   -0.205013
2013-01-08   -1.284152
2013-01-05    0.018700
2013-01-04   -0.503527
2013-01-01    0.073035
2013-01-03    0.695904
dtype: float64

In [26]: s['20130104':'20130105']
Out[26]: Series([], dtype: float64)

In [27]: s['20130104':'20130107']
Out[27]: Series([], dtype: float64)

In [28]: s['20130102':'20130107']
Out[28]: Series([], dtype: float64)

In [29]: s['20130102':'20130104']
Out[29]: 
2013-01-02   -0.205013
2013-01-08   -1.284152
2013-01-05    0.018700
2013-01-04   -0.503527
dtype: float64

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDtype ConversionsUnexpected or buggy dtype conversionsIndexingRelated to indexing on series/frames, not to indexes themselves

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions