Skip to content

DOC: "Invalid datetime unit in metadata string "[d]"" #6855

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
jorisvandenbossche opened this issue Apr 10, 2014 · 2 comments · Fixed by #6858
Closed

DOC: "Invalid datetime unit in metadata string "[d]"" #6855

jorisvandenbossche opened this issue Apr 10, 2014 · 2 comments · Fixed by #6858
Assignees
Labels
Docs Timedelta Timedelta data type
Milestone

Comments

@jorisvandenbossche
Copy link
Member

http://pandas-docs.github.io/pandas-docs-travis/timeseries.html#time-deltas-conversions

In [253]: to_timedelta(np.arange(5),unit='d')
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-253-bab05b276f33> in <module>()
----> 1 to_timedelta(np.arange(5),unit='d')

/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/pandas/tseries/timedeltas.pyc in to_timedelta(arg, box, unit)
     61         return Series(values, index=arg.index, name=arg.name, dtype='m8[ns]')
     62     elif is_list_like(arg):
---> 63         return _convert_listlike(arg, box=box, unit=unit)
     64 
     65     # ...so it must be a scalar value. Return scalar.

/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/pandas/tseries/timedeltas.pyc in _convert_listlike(arg, box, unit)
     42         elif is_integer_dtype(arg):
     43             # these are shortcutable
---> 44             value = arg.astype('timedelta64[{0}]'.format(unit)).astype('timedelta64[ns]')
     45         else:
     46             try:

TypeError: Invalid datetime unit in metadata string "[d]"
@jorisvandenbossche
Copy link
Member Author

The same error in whatsnew of 0.13: http://pandas-docs.github.io/pandas-docs-travis/whatsnew.html#id11

Did there change something recently?

@jreback
Copy link
Contributor

jreback commented Apr 10, 2014

yeh...i think i made a change, guess I broke this; numpy doesn't like 'd' in timedelta64, only 'D'
(which is odd if you ask me, but ok).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants