-
Arrayterator.flat
-
A 1-D flat iterator for Arrayterator objects.
This iterator returns elements of the array to be iterated over in
Arrayterator
one by one. It is similar toflatiter
.See also
Arrayterator
,flatiter
Examples
12>>> a
=
np.arange(
3
*
4
*
5
*
6
).reshape(
3
,
4
,
5
,
6
)
>>> a_itor
=
np.lib.Arrayterator(a,
2
)
12345>>>
for
subarr
in
a_itor.flat:
...
if
not
subarr:
...
print
(subarr,
type
(subarr))
...
0
<
type
'numpy.int32'
>
Arrayterator.flat

2025-01-10 15:47:30
Please login to continue.