cf.Data.flat

Data.flat(ignore_masked=True)[source]

Return a flat iterator over elements of the data array.

Parameters :
ignore_masked : bool, optional

If False then masked and unmasked elements will be returned. By default only unmasked elements are returned

Returns :
out : generator

An iterator over elements of the data array.

Examples

>>> print d.array
[[1 -- 3]]
>>> for x in d.flat():
...     print x
...
1
3
>>> for x in d.flat(False):
...     print x
...
1
--
3

Previous topic

cf.Data.expand_partition_dims

Next topic

cf.Data.flip

This Page