Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8178953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:53:30+00:00 2026-06-06T23:53:30+00:00

times = [datetime(2011, 01, 03, 0, 10 + i, 0) for i in range(5)]

  • 0
times = [datetime(2011, 01, 03, 0, 10 + i, 0) for i in range(5)]
series = pd.TimeSeries(range(5), index=times)
series.ix[datetime(2011, 01, 03, 0, 10, 0):datetime(2011, 01, 03, 0, 13, 0)]

2011-01-03 00:10:00    0
2011-01-03 00:11:00    1
2011-01-03 00:12:00    2
2011-01-03 00:13:00    3

but

x = range(5)
x[0:3]
[0, 1, 2]

Also,

times = [datetime.datetime(2000, 1, 1) + datetime.timedelta(minutes=i) for i in range(1000000 - 1)]
df = pd.TimeSeries(range(1000000 - 1), times)
len(df.ix[datetime.datetime(1900,1,1):datetime.datetime(2100,1,1)])

999999

But

times = [datetime.datetime(2000, 1, 1) + datetime.timedelta(minutes=i) for i in range(1000000)]
df = pd.TimeSeries(range(1000000), times)
len(df.ix[datetime.datetime(1900,1,1):datetime.datetime(2100,1,1)])

Traceback (most recent call last):

  File "C:\Program Files (x86)\Wing IDE 4.1\src\debug\tserver\_sandbox.py", line 1, in <module>
    # Used internally for debug sandbox under external interpreter
  File "C:\dev\Python26\Lib\site-packages\pandas\core\indexing.py", line 35, in __getitem__
    return self._getitem_axis(key, axis=0)
  File "C:\dev\Python26\Lib\site-packages\pandas\core\indexing.py", line 234, in _getitem_axis
    return self._get_slice_axis(key, axis=axis)
  File "C:\dev\Python26\Lib\site-packages\pandas\core\indexing.py", line 460, in _get_slice_axis
    i, j = labels.slice_locs(start, stop)
  File "C:\dev\Python26\Lib\site-packages\pandas\tseries\index.py", line 949, in slice_locs
    return Index.slice_locs(self, start, end)
  File "C:\dev\Python26\Lib\site-packages\pandas\core\index.py", line 1057, in slice_locs
    end_slice = self.get_loc(end) + 1
  File "C:\dev\Python26\Lib\site-packages\pandas\tseries\index.py", line 919, in get_loc
    return self._engine.get_loc(key)
  File "C:\dev\Python26\Lib\site-packages\pandas\lib.pyd", line 378, in pandas.lib.DatetimeEngine.get_loc (pandas\src\tseries.c:108808)
  File "C:\dev\Python26\Lib\site-packages\pandas\lib.pyd", line 390, in pandas.lib.DatetimeEngine.get_loc (pandas\src\tseries.c:108422)
  File "C:\dev\Python26\Lib\site-packages\pandas\lib.pyd", line 32, in util.get_value_at (pandas\src\tseries.c:112091)
IndexError: index out of bounds
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T23:53:32+00:00Added an answer on June 6, 2026 at 11:53 pm

    From the documentation:

    Slicing with labels is semantically slightly different because the slice start and stop are inclusive in the label-based case

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi i need group the records based on the time stmap datetime column 2011-11-23
Need to check if DateTime is in specific range. I think I need to
I follow the tutorial here http://blog.bdoughan.com/2011/05/jaxb-and-joda-time-dates-and-times.html to use joda DateTime with jersey. But I
I have a table and the date-times in it are in the format: 2011-07-01
I have datetime range: var _checkInYear = (from d in db.bookings select d.checkinyear).ToList(); var
I am running in very strange date range query problem. When I use DateTime.now.utc
I am getting time in string like this 2011-02-27T10:03:33.099-06:00 which is of xml dateTime
I have a datetime string in the form of a string as: 2011-10-23T08:00:00-07:00 How
I need to convert a Joda-Time DateTime into a String, in the following format:
t1 = datetime.time(12, 10, 0, tzinfo=GMT1()) # 12:10 t2 = datetime.time(13, 13, 0, tzinfo=GMT1())

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.