cf.Data.square¶
-
Data.
square
(dtype=None, inplace=False)[source]¶ Calculate the element-wise square.
New in version 3.14.0.
See also
- Parameters
- Returns
Examples
>>> d = cf.Data([[0, 1, 2.5, 3, 4]], 'K', mask=[[0, 0, 0, 1, 0]]) >>> print(d.array) [[0.0 1.0 2.5 -- 4.0]] >>> e = d.square() >>> e <CF Data(1, 5): [[0.0, ..., 16.0]] K2> >>> print(e.array) [[0.0 1.0 6.25 -- 16.0]]