cf.Data.func

Data.func(f, units=None, i=False)[source]

Apply an element-wise array operation to the data array in place.

Parameters :
f : function

The function to be applied.

Returns :

None

Examples

>>> print d.array
[[ 0.          1.57079633]
 [ 3.14159265  4.71238898]]
>>> import numpy
>>> d.func(numpy.cos, i=True)
>>> print d.array
[[ 1.0  0.0]
 [-1.0  0.0]]

Previous topic

cf.Data.flip

Next topic

cf.Data.loadd

This Page