micropython-ulab icon indicating copy to clipboard operation
micropython-ulab copied to clipboard

Numpy compatibility for the type of single ndarray members

Open arnonsen opened this issue 4 years ago • 1 comments

On formal Numpy, the output for print(type((np.array([1],dtype=np.int32)[0]))) is <class 'numpy.int32'>, the array items keeps their types when used as scalars. On ulab the items out of the array becomes 'int' or 'float'. Is it worthwhile supporting this feature on Ulab, is there any added value for this feature ?

arnonsen avatar Jun 01 '21 18:06 arnonsen

@arnonsen

On ulab the items out of the array becomes 'int' or 'float'. Is it worthwhile supporting this feature on Ulab, is there any added value for this feature ?

I don't think so: the micropython objects are integers or floats, there is no distinction between uint8, and int16. I believe, the only case, where the type of the integer matters is, when you pair it with an ndarray. But I have just sorted that out.

v923z avatar Jun 01 '21 18:06 v923z