We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
>>> pd.Timedelta(1, 'd') Timedelta('1 days 00:00:00') >>> pd.Timedelta('1d') Timedelta('1 days 00:00:00') >>> pd.Timedelta(1, 'Y') Timedelta('365 days 05:49:12') >>> pd.Timedelta('1Y') Traceback (most recent call last): File "pandas/_libs/tslibs/timedeltas.pyx", line 294, in pandas._libs.tslibs.timedeltas.timedelta_from_spec KeyError: 'y' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "pandas/_libs/tslib.pyx", line 2588, in pandas._libs.tslib.Timedelta.__new__ File "pandas/_libs/tslibs/timedeltas.pyx", line 251, in pandas._libs.tslibs.timedeltas.parse_timedelta_string File "pandas/_libs/tslibs/timedeltas.pyx", line 296, in pandas._libs.tslibs.timedeltas.timedelta_from_spec ValueError: invalid abbreviation: Y
Units beyond day (e.g., week month year) are not supported in timedelta_abbrevs, but explicitly specifying by param unit= is supported.
day
week
month
year
timedelta_abbrevs
unit=
Is it OK to add supported of they in timedelta_abbrevs too?
pd.show_versions()
commit: None python: 3.6.4.final.0 python-bits: 64 OS: Darwin OS-release: 17.3.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: None LANG: zh_CN.UTF-8 LOCALE: zh_CN.UTF-8
pandas: 0.21.1 pytest: None pip: 9.0.1 setuptools: 36.5.0 Cython: None numpy: 1.13.3 scipy: 1.0.0 pyarrow: None xarray: None IPython: None sphinx: None patsy: None dateutil: 2.6.1 pytz: 2017.3 blosc: None bottleneck: None tables: None numexpr: None feather: None matplotlib: 2.1.1 openpyxl: None xlrd: None xlwt: None xlsxwriter: 1.0.2 lxml: None bs4: 4.6.0 html5lib: None sqlalchemy: None pymysql: 0.7.11.None psycopg2: None jinja2: None s3fs: None fastparquet: None pandas_gbq: None pandas_datareader: None
The text was updated successfully, but these errors were encountered:
see #16344 we want to remove these entirely; these are not fixed lengths of time and thus very confusing for a Timedelta.
Sorry, something went wrong.
certainly welcome for a PR on #16344
No branches or pull requests
Code Sample, a copy-pastable example if possible
Problem description
Units beyond
day
(e.g.,week
month
year
) are not supported intimedelta_abbrevs
, but explicitly specifying by paramunit=
is supported.Is it OK to add supported of they in
timedelta_abbrevs
too?Expected Output
Output of
pd.show_versions()
[paste the output of
pd.show_versions()
here below this line]INSTALLED VERSIONS
commit: None
python: 3.6.4.final.0
python-bits: 64
OS: Darwin
OS-release: 17.3.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: zh_CN.UTF-8
LOCALE: zh_CN.UTF-8
pandas: 0.21.1
pytest: None
pip: 9.0.1
setuptools: 36.5.0
Cython: None
numpy: 1.13.3
scipy: 1.0.0
pyarrow: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.6.1
pytz: 2017.3
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 2.1.1
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: 1.0.2
lxml: None
bs4: 4.6.0
html5lib: None
sqlalchemy: None
pymysql: 0.7.11.None
psycopg2: None
jinja2: None
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: