Skip to content

BUG: infer_date fails to infer semi-month frequencies #45819

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

Open
3 tasks done
rodrigolece opened this issue Feb 4, 2022 · 2 comments
Open
3 tasks done

BUG: infer_date fails to infer semi-month frequencies #45819

rodrigolece opened this issue Feb 4, 2022 · 2 comments
Labels
Bug Frequency DateOffsets

Comments

@rodrigolece
Copy link

rodrigolece commented Feb 4, 2022

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

>>> import pandas as pd
>>> idx = pd.date_range("2017", freq="SMS", periods=4)
>>> idx
DatetimeIndex(['2017-01-01', '2017-01-15', '2017-02-01', '2017-02-15'],
              dtype='datetime64[ns]', freq='SMS-15')
>>> pd.infer_freq(idx)
# returns None
>>> idx = pd.date_range("2017", freq="SM", periods=4)
>>> pd.infer_freq(idx)
# returns None

Issue Description

The infer_freq method fails to infer the a Semi-Month frequency (both regular and start)

Expected Behavior

>>> idx = pd.date_range("2017", freq="SMS", periods=4)
>>> pd.infer_freq(idx)
'SMS'

Installed Versions

NSTALLED VERSIONS

commit : bb1f651
python : 3.9.7.final.0
python-bits : 64
OS : Linux
OS-release : 5.4.0-96-generic
Version : #109-Ubuntu SMP Wed Jan 12 16:49:16 UTC 2022
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_GB.UTF8
LOCALE : en_GB.UTF-8

pandas : 1.4.0
numpy : 1.20.1
pytz : 2021.3
dateutil : 2.8.2
pip : 21.2.4
setuptools : 58.0.4
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.0.2
IPython : 7.22.0
pandas_datareader: None
bs4 : None
bottleneck : 1.3.2
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : 3.3.4
numba : None
numexpr : 2.8.1
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.6.2
sqlalchemy : None
tables : None
tabulate : 0.8.9
xarray : None
xlrd : None
xlwt : None
zstandard : None

@rodrigolece rodrigolece added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Feb 4, 2022
@jbrockmendel
Copy link
Member

pls give the issue an informative name

@rodrigolece rodrigolece changed the title BUG: BUG: infer_date fails to infer semi-month frequencies Feb 5, 2022
@rodrigolece
Copy link
Author

Really sorry, I was more concerned about filling all the fields, copying the reproducible code etc and I forgot!

@mroeschke mroeschke added Frequency DateOffsets and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Frequency DateOffsets
Projects
None yet
Development

No branches or pull requests

3 participants