cf.Data.unsafe_array

Data.unsafe_array

A numpy array of the data array.

It is unsafe because it might (or might not) be view to the master data array - you just don’t know. So changing the returned array in place might have dire consequences.

It is useful because if you are 100% certain that you’re not going to change the returned array in place then this method may be much faster than the array method.

Why not just use the varray method? Well, you might not want to destroy the partition matrix.

The data type of the array is as returned by the dtype attribute.

Examples

>>> a = d.unsafe_array
>>> isinstance(a, numpy.ndarray)
True

Previous topic

cf.Data.Units

Next topic

cf.Data.varray

This Page