You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Noticing an inconsistency. pd.Timedelta doesn't allow nanoseconds in constructor but its components list till nanoseconds. Here is what I can reproduce. (used then current master on OS X 10.10.1)
Example:
Python 2.7.9 (v2.7.9:648dcafa7e5f, Dec 10 2014, 10:10:46)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pandas.tslib import Timedelta
>>> td = Timedelta(nanoseconds=1)
Traceback (most recent call last):
File "", line 1, in
File "pandas/tslib.pyx", line 1723, in pandas.tslib.Timedelta.__new__ (pandas/tslib.c:29743)
raise ValueError("cannot construct a TimeDelta from the passed arguments, allowed keywords
are " [days, seconds, microseconds, milliseconds, minutes, hours, weeks]
>>> td=Timedelta(seconds=1)
>>> td.components._fields
('days', 'hours', 'minutes', 'seconds', 'milliseconds', 'microseconds', 'nanoseconds')
The text was updated successfully, but these errors were encountered:
tvyomkesh
changed the title
Support for nanoseconds broken in pd.Timedelta
pd.Timedelta constructor should accept nanoseconds in the arguments
Jan 17, 2015
@jreback I have changed the title accordingly. Timdelta constructor fails to accept when nanoseconds is supplied as an attribute but otherwise pd.Timedelta does support nanoseconds. Also default resolution in the constructor is nanoseconds. For e.g.,
In [7]: t4 = Timedelta(100)
In [8]: t4.components
Out[8]: Components(days=0, hours=0, minutes=0, seconds=0, milliseconds=0, microseconds=0, nanoseconds=100)
Moved DateOffset nano related issue to a separate one here #9284 as it seems like a separate issue and not related to this one.
tvyomkesh
changed the title
pd.Timedelta constructor should accept nanoseconds in the arguments
pd.Timedelta constructor should accept nanoseconds attribute in the arguments
Jan 17, 2015
xref #9226
Noticing an inconsistency. pd.Timedelta doesn't allow nanoseconds in constructor but its components list till nanoseconds. Here is what I can reproduce. (used then current master on OS X 10.10.1)
Example:
The text was updated successfully, but these errors were encountered: