You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected to return every hour of a day from midnight to 16:00, but when including end='16:00' that last hour isn't captured. Per the doc it states that end defaults to '16:00'. You can put any hour for end and it doesn't capture that final hour.
I am not sure that there is a problem here. It looks like expected behavior. The return value contains the beginning of every business hour. That is why 16:00 is not included in this case.
The example from the issue description may be useful to clarify the behavior of CustomBusinessHour. Probably, documentation for CustomBusinessHour can be updated. @MarcoGorelli, what do you think?
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
Expected to return every hour of a day from midnight to 16:00, but when including end='16:00' that last hour isn't captured. Per the doc it states that end defaults to '16:00'. You can put any hour for end and it doesn't capture that final hour.
Expected Behavior
import pandas as pd
import datetime as dt
freq = pd.offsets.CustomBusinessHour(weekmask="Sat Sun", start="00:00", end="16:00")
pd.date_range(dt.datetime(2020,1,1), dt.datetime(2020,1,15), freq=freq)
Expected:
Installed Versions
INSTALLED VERSIONS
commit : 91111fd
python : 3.9.2.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.19041
machine : AMD64
processor : Intel64 Family 6 Model 165 Stepping 5, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_United States.1252
pandas : 1.5.1
numpy : 1.23.4
pytz : 2022.2.1
dateutil : 2.8.2
setuptools : 65.3.0
pip : 22.2.2
Cython : None
pytest : 7.2.0
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : 3.0.3
lxml.etree : 4.9.1
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.4.0
pandas_datareader: None
bs4 : 4.11.1
bottleneck : None
brotli :
fastparquet : None
fsspec : 2022.8.2
gcsfs : None
matplotlib : 3.6.1
numba : None
numexpr : None
odfpy : None
openpyxl : 3.0.10
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : 1.0.10
s3fs : None
scipy : 1.8.1
snappy : None
sqlalchemy : 1.4.40
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
zstandard : None
tzdata : 2022.2
The text was updated successfully, but these errors were encountered: