We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
import pandas as pd index = pd.DatetimeIndex(start='1990', end='1994', freq='AS') print(index) print(index[:]) print(index[...])
yields:
DatetimeIndex(['1990-01-01', '1991-01-01', '1992-01-01', '1993-01-01', '1994-01-01'], dtype='datetime64[ns]', freq='AS-JAN') DatetimeIndex(['1990-01-01', '1991-01-01', '1992-01-01', '1993-01-01', '1994-01-01'], dtype='datetime64[ns]', freq='AS-JAN') DatetimeIndex(['1990-01-01', '1991-01-01', '1992-01-01', '1993-01-01', '1994-01-01'], dtype='datetime64[ns]', freq=None)
The frequency information in a DatetimeIndex is lost if all elements are selected via an ellipses.
DatetimeIndex
(Note this also happens with e.g. index[:, ...] or with index[[True, True, True, True, True], ...]).
index[:, ...]
index[[True, True, True, True, True], ...]
DatetimeIndex(['1990-01-01', '1991-01-01', '1992-01-01', '1993-01-01', '1994-01-01'], dtype='datetime64[ns]', freq='AS-JAN') DatetimeIndex(['1990-01-01', '1991-01-01', '1992-01-01', '1993-01-01', '1994-01-01'], dtype='datetime64[ns]', freq='AS-JAN') DatetimeIndex(['1990-01-01', '1991-01-01', '1992-01-01', '1993-01-01', '1994-01-01'], dtype='datetime64[ns]', freq='AS-JAN')
pd.show_versions()
commit: None python: 3.6.5.final.0 python-bits: 64 OS: Darwin OS-release: 15.6.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8
pandas: 0.23.0 pytest: 3.5.1 pip: 10.0.1 setuptools: 39.1.0 Cython: None numpy: 1.14.2 scipy: 1.1.0 pyarrow: None xarray: None IPython: 6.4.0 sphinx: 1.7.4 patsy: 0.5.0 dateutil: 2.7.3 pytz: 2018.4 blosc: None bottleneck: None tables: None numexpr: None feather: None matplotlib: 2.2.2 openpyxl: None xlrd: None xlwt: None xlsxwriter: None lxml: None bs4: None html5lib: 1.0.1 sqlalchemy: None pymysql: None psycopg2: None jinja2: 2.10 s3fs: None fastparquet: None pandas_gbq: None pandas_datareader: None
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Code Sample, a copy-pastable example if possible
yields:
Problem description
The frequency information in a
DatetimeIndex
is lost if all elements are selected via an ellipses.(Note this also happens with e.g.
index[:, ...]
or withindex[[True, True, True, True, True], ...]
).Expected Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.6.5.final.0
python-bits: 64
OS: Darwin
OS-release: 15.6.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.23.0
pytest: 3.5.1
pip: 10.0.1
setuptools: 39.1.0
Cython: None
numpy: 1.14.2
scipy: 1.1.0
pyarrow: None
xarray: None
IPython: 6.4.0
sphinx: 1.7.4
patsy: 0.5.0
dateutil: 2.7.3
pytz: 2018.4
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 2.2.2
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: 1.0.1
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: