-
Notifications
You must be signed in to change notification settings - Fork 118
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
[BUG] Reshaping a slice creates an empty array #658
Comments
I get c.reshape((1,6))
array([[0.0],
[6.0],
[12.0],
[18.0],
[24.0],
[30.0]], dtype=float64) which is also wrong. |
I think that is correct: c is looking at the first column, b is looking at the first row. My demo code was running on a nrf52840 in circuitpython Phil |
Sorry, didn't look at your result properly. I see the issue... |
Just had a look at numpy docs for reshape: "it is not always possible to change the shape of an array without copying the data" |
Yes, that's correct, but your particular example should still be doable without copying. I'll try to sort out the issue. |
Fixed in #660 |
Describe the bug
Calling
reshape
on a slice of an array can lead to an empty array.ulab version 6.4.1-2D
To Reproduce
Expected behavior
c
should be[[0.0, 6.0, 12.0, 18.0, 24.0, 30.0]]
, not[]
Additional context
This seems to be a result of recent changes. Ulab (6.0.12) that came with circuitpython 8.1 did not have this issue
The text was updated successfully, but these errors were encountered: