-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
period_range creates wrong dates when freq has multiple offsets #13730
Comments
Confirmed on master, thanks for reporting! |
Yeah, |
@sinhrks In some way it already does coerce the combination correctly to a single freq, as in the output of the examples you see |
@jorisvandenbossche yes "150T" should work after #7832. What I tried to mean is coercing "2H30T" to "150T" internally. |
Yep, I understood that :-) What I meant is that somewhere this coercing already happens (only not in the right place for letting this work), since:
gives the correct freq, only not the correct values |
Ah i see... i haven't understood the phenomenon. |
A question about this has been posted on StackOverflow today. An interesting observation made there is that
gives the
while
(notice the reversal of the
|
@agraboso Your example both look incorrect. 1st one should have 25H freq rather than 1H. 1st and 2nd should output the same result. |
@sinhrks You're right, of course. I looked at the first element and the hour on the rest and thought it was fine, but it is not. |
Code Sample, a copy-pastable example if possible
date_range
works fine:Expected Output
The
freq
is right, but I'd expect the PeriodIndex to start at 2016-07-20, not in 1970, and to display 2h30 increments, something like:Or, if
freq
that combine multiple offsets are note supported, to at least raise and error.output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 2.7.11.final.0
python-bits: 64
OS: Darwin
OS-release: 15.5.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
pandas: 0.18.0
nose: 1.3.7
pip: 8.1.2
setuptools: 23.1.0
Cython: 0.24
numpy: 1.10.4
scipy: 0.17.1
statsmodels: 0.6.1
xarray: 0.7.2
IPython: 4.1.2
sphinx: 1.4.1
patsy: 0.4.1
dateutil: 2.5.2
pytz: 2016.3
blosc: 1.2.8
bottleneck: 1.1.0
tables: 3.2.2
numexpr: 2.6.0
matplotlib: 1.5.1
openpyxl: 2.3.4
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.9.2
lxml: 3.6.0
bs4: 4.4.1
html5lib: 0.999
httplib2: 0.9.2
apiclient: None
sqlalchemy: 1.0.12
pymysql: 0.6.7.None
psycopg2: None
jinja2: 2.8
boto: 2.40.0
The text was updated successfully, but these errors were encountered: