>>> np.iinfo('intc')
iinfo(min=-2147483648, max=2147483647, dtype=int32)
>>> np.iinfo('uintc')
iinfo(min=0, max=4294967295, dtype=uint32)
>>> np.iinfo('longlong')
iinfo(min=-9223372036854775808, max=9223372036854775807, dtype=int64)
>>> np.iinfo('ulonglong')
iinfo(min=0, max=18446744073709551615, dtype=uint64)
>>> np.iinfo('long')
iinfo(min=-9223372036854775808, max=9223372036854775807, dtype=int64)
>>> np.iinfo('ulong')
Traceback (most recent call last):
File "<ipython-input-20-e783aa7ef3c1>", line 1, in <module>
np.iinfo('ulong')
File "/home/antoine/miniconda3/envs/pyarrow/lib/python3.6/site-packages/numpy/core/getlimits.py", line 516, in __init__
raise ValueError("Invalid integer data type.")
ValueError: Invalid integer data type.
Easy fix here is to use np.iinfo(np.uint)
I think this is because 'long'
is decoded to __buitins__.long
According to https://docs.scipy.org/doc/numpy/user/basics.types.html :
Additionally to intc the platform dependent C integer types short, long, longlong and their unsigned versions are defined.
Docs are wrong. The C integer type long
is called np.int_
, and the integer type unsigned long
is called np.uint
As far as I can see, this should be fixed in #11837 as well? :)
Thanks for finding this @ax3l
You are welcome, can only forward the thanks to @C0nsultant we pointed me here :)
Most helpful comment
Thanks for finding this @ax3l