Skip to content
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

Numpy compatibility for the type of single ndarray members #400

Open
arnonsen opened this issue Jun 1, 2021 · 1 comment
Open

Numpy compatibility for the type of single ndarray members #400

arnonsen opened this issue Jun 1, 2021 · 1 comment
Labels
enhancement New feature or request numpy compatibility a function's behaviour doesn't conform to `numpy`

Comments

@arnonsen
Copy link

arnonsen commented Jun 1, 2021

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 arnonsen added the enhancement New feature or request label Jun 1, 2021
@v923z
Copy link
Owner

v923z commented Jun 1, 2021

@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 v923z added the numpy compatibility a function's behaviour doesn't conform to `numpy` label Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request numpy compatibility a function's behaviour doesn't conform to `numpy`
Projects
None yet
Development

No branches or pull requests

2 participants