[SciPy-Dev] Baffled by type_check.datetime_data

David Goldsmith d.l.goldsmith at gmail.com
Tue Apr 27 21:57:43 EDT 2010


>>> np.version.version
'1.4.0'
>>> from numpy.lib.type_check import datetime_data as dtd
>>> help(dtd)
Help on function datetime_data in module numpy.lib.type_check:

datetime_data(dtype)
    Return (unit, numerator, denominator, events) from a datetime dtype

>>> np.dtype(np.datetime_)
dtype('datetime64[us]')
>>> dtd(np.datetime_)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python26\lib\site-packages\numpy\lib\type_check.py", line 611, in
dat
etime_data
    if dtype.kind not in ['m','M']:
AttributeError: type object 'numpy.datetime64' has no attribute 'kind'
>>> for key in np.sctypes.keys():
...     for val in np.sctypes[key]:
...         if 'kind' in dir(val):
...             print np.sctype[key][val]
...
>>>

Bug, or failure to understand usage?  (If the latter, someone please
explain.)

DG

-- 
Mathematician: noun, someone who disavows certainty when their uncertainty
set is non-empty, even if that set has measure zero.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20100427/336e57cb/attachment.html>


More information about the SciPy-Dev mailing list