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

Pandas future warning issued when getting schedule for a half day #239

Open
jon23d opened this issue Jan 2, 2023 · 1 comment
Open

Pandas future warning issued when getting schedule for a half day #239

jon23d opened this issue Jan 2, 2023 · 1 comment

Comments

@jon23d
Copy link

jon23d commented Jan 2, 2023

Here is a sample showing two failure cases and one success case. The failures occur on half days when start and end dates are the same.

>>> import pandas_market_calendars as mcal
>>> from datetime import datetime
>>> calendar = mcal.get_calendar('NYSE')

>>> dt = datetime(2022, 11, 25)
>>> print(calendar.schedule(start_date=dt, end_date=dt, tz='America/New_York'))
<stdin>:1: FutureWarning: In a future version, `df.iloc[:, i] = newvals` will attempt to set the values inplace instead of always setting a new array. To retain the old behavior, use either `df[df.columns[i]] = newvals` or, if columns are non-unique, `df.isetitem(i, newvals)`
                         market_open              market_close
2022-11-25 2022-11-25 09:30:00-05:00 2022-11-25 13:00:00-05:00

>>> dt = datetime(2023, 7, 3)
>>> print(calendar.schedule(start_date=dt, end_date=dt, tz='America/New_York'))
<stdin>:1: FutureWarning: In a future version, `df.iloc[:, i] = newvals` will attempt to set the values inplace instead of always setting a new array. To retain the old behavior, use either `df[df.columns[i]] = newvals` or, if columns are non-unique, `df.isetitem(i, newvals)`
                         market_open              market_close
2023-07-03 2023-07-03 09:30:00-04:00 2023-07-03 13:00:00-04:00

>>> dt = datetime(2023, 7, 5)
>>> print(calendar.schedule(start_date=dt, end_date=dt, tz='America/New_York'))
                         market_open              market_close
2023-07-05 2023-07-05 09:30:00-04:00 2023-07-05 16:00:00-04:00

My system is running MacOS Monterey, python 3.10, and pandas market calendars 4.1.1

@RaduCiumag
Copy link

Same behaviours on Python 3.9.6 and pandas_market_calendars 4.1.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants