Open simolon opened 2 years ago
I believe the flatiter might not be handled correctly.
import numpoly X = numpoly.variable(6).reshape((3,2)) print('using flatten:') for p in X.flatten(): print(p) print('using flat:') for p in X.flat: print(p)
output:
using flatten: q0 q1 q2 q3 q4 q5 using flat: (1, 0, 0, 0, 0, 0) (0, 1, 0, 0, 0, 0) (0, 0, 1, 0, 0, 0) (0, 0, 0, 1, 0, 0) (0, 0, 0, 0, 1, 0) (0, 0, 0, 0, 0, 1)
Access to the real ndarray.flat isn't very simple as it needs to medle with the underlying implementation of np.flatiter object.
ndarray.flat
np.flatiter
But I can easily mimic the behavior, so I did just that. Released in v1.2.4 now.
I believe the flatiter might not be handled correctly.
output: