cf.Data.dtype¶

Data.
dtype
¶ The
numpy
datatype of the data.Always returned as a
numpy
datatype instance, but may be set as any object that converts to anumpy
datatype.Examples
>>> d = cf.Data([1, 2.5, 3.9]) >>> d.dtype dtype('float64') >>> print(d.array) [1. 2.5 3.9] >>> d.dtype = int >>> d.dtype dtype('int64') >>> print(d.array) [1 2 3] >>> d.dtype = 'float32' >>> print(d.array) [1. 2. 3.] >>> import numpy as np >>> d.dtype = np.dtype('int32') >>> d.dtype dtype('int32') >>> print(d.array) [1 2 3]