Skip to content

DatetimeIndex with a frequency greater than dates range now returns only one value #11593

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

Closed
edouardruiz opened this issue Nov 13, 2015 · 3 comments
Labels
Frequency DateOffsets

Comments

@edouardruiz
Copy link

There's a different behavior between 0.16.0 and 0.17.0 on a DatetimeIndex creation with a frequency greater than the dates range:

import pandas as pd
pd.DatetimeIndex(start=pd.Timestamp('2015-04-15'), end=pd.Timestamp('2015-04-18'), freq='7D')

With previous versions I had a DatetimeIndex of length 2: [2015-04-15, 2015-04-22].

With 0.17.0 I get an index with only one value: ['2015-04-15'].

Is it a bug/regression? Is there a way to reproduce the previous behavior?

Here are the the results of pd.show_versions():

  • 0.16.0
INSTALLED VERSIONS
------------------
commit: None
python: 2.7.10.final.0
python-bits: 32
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 60 Stepping 3, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None

pandas: 0.16.0
nose: 1.3.7
Cython: 0.23.4
numpy: 1.10.1
scipy: 0.16.0
statsmodels: 0.6.1
IPython: 4.0.0
sphinx: 1.3.1
patsy: 0.4.0
dateutil: 2.4.1
pytz: 2015.7
bottleneck: 1.0.0
tables: 3.2.2
numexpr: 2.4.4
matplotlib: 1.4.3
openpyxl: 2.2.6
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.7.7
lxml: 3.4.4
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.9
pymysql: None
psycopg2: None
  • 0.17.0
INSTALLED VERSIONS
------------------
commit: None
python: 2.7.10.final.0
python-bits: 32
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None

pandas: 0.17.0
nose: 1.3.7
pip: 7.1.2
setuptools: 18.4
Cython: 0.23.4
numpy: 1.10.1
scipy: 0.16.0
statsmodels: 0.6.1
IPython: 4.0.0
sphinx: 1.3.1
patsy: 0.4.0
dateutil: 2.4.1
pytz: 2015.7
blosc: None
bottleneck: 1.0.0
tables: 3.2.2
numexpr: 2.4.4
matplotlib: 1.4.3
openpyxl: 2.2.6
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.7.7
lxml: 3.4.4
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.9
pymysql: None
psycopg2: None
@jreback
Copy link
Contributor

jreback commented Nov 13, 2015

In [19]: DatetimeIndex(start=pd.Timestamp('2015-04-15'), periods=2, freq='7D')
Out[19]: DatetimeIndex(['2015-04-15', '2015-04-22'], dtype='datetime64[ns]', freq='7D')

IIRC this was a bug previously, @sinhrks ?

@jreback jreback added the Frequency DateOffsets label Nov 13, 2015
@kawochen
Copy link
Contributor

it was #10885?

@jreback
Copy link
Contributor

jreback commented Nov 13, 2015

@kawochen right! thanks.

@jreback jreback closed this as completed Nov 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frequency DateOffsets
Projects
None yet
Development

No branches or pull requests

3 participants