Skip to content

Index out of bounds #203

@Hammy27

Description

@Hammy27

When using this code:

import trading_calendars as tc
exchange = tc.get_calendar('XSWX')
exchange.next_open(pd.Timestamp('2021-12-27')

an index 8032 is out of bounds error for axis 0 with size 8032 is thrown.

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Users\raphael\anaconda3\envs\levine\lib\site-packages\trading_calendars\trading_calendar.py", line 462, in next_open
    idx = next_divider_idx(self.market_opens_nanos, dt.value)
  File "C:\Users\raphael\anaconda3\envs\levine\lib\site-packages\trading_calendars\calendar_helpers.py", line 12, in next_divider_idx
    target = dividers[divider_idx]
IndexError: index 8032 is out of bounds for axis 0 with size 8032

Seems to be a pandas Problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions