Skip to content
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

PeriodIndex slicing by datetime fails when either end out-of-bounds #1977

Closed
ijmcf opened this issue Sep 26, 2012 · 1 comment
Closed

PeriodIndex slicing by datetime fails when either end out-of-bounds #1977

ijmcf opened this issue Sep 26, 2012 · 1 comment
Labels
Bug Datetime Datetime data dtype
Milestone

Comments

@ijmcf
Copy link

ijmcf commented Sep 26, 2012

pi = pandas.PeriodIndex(start='2012-01-01', periods=10, freq='W-MON')
ts = pandas.TimeSeries(range(len(pi)), index=pi)

dt1 = datetime.datetime(2011, 10, 2)
dt2 = datetime.datetime(2012, 1, 2)
dt3 = datetime.datetime(2012, 2, 10)
dt4 = datetime.datetime(2012, 4, 20)

ts[dt2: dt3]
ts[dt1: dt3]
ts[dt2: dt4]

The first slice works, the second and third do not. It looks like the code that handles 'out-of-bounds' slices is failing in this case.

@wesm
Copy link
Member

wesm commented Sep 26, 2012

Fixed with the referenced commit

@wesm wesm closed this as completed Sep 26, 2012
yarikoptic added a commit to neurodebian/pandas that referenced this issue Sep 27, 2012
Version 0.9.0 Release Candidate 2

* tag 'v0.9.0rc2':
  DOC: release notes, bump to RC2
  DOC: missed a few for release notes 0.9
  DOC: add a few more notes on bug fixes in release.rst
  BUG: repr fix for all-NA index level. close pandas-dev#1971
  BLD: don't link against math library on windows
  TST: kludge around test failure on win64 python 3.2.2
  BLD: link against math library explicitly. close pandas-dev#1955
  DOC: Add line about resetting to default index
  DOC: Adding details on normalization for variance functions.
  DOC: Specify default merge behavior for on = None
  BUG: PeriodIndex slicing by datetime fails when either end out-of-bounds pandas-dev#1977
  BUG: read_table unicode bug pandas-dev#1975
  BUG: BlockManager.iget fails with non-unique MultiIndex pandas-dev#1970
  Better error message for DataFrame.apply if axis is not 0 or 1
  TST: fix up tzlocal test cases
  DOC: add level option in Series.reset_index to release notes
  ENH: level parameter for Series.reset_index
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype
Projects
None yet
Development

No branches or pull requests

2 participants