cfdm.SparseArray¶
- class cfdm.SparseArray(array=None, source=None, copy=True)[source]¶
Bases:
ArrayAn underlying sparse array.
The sparse array is assumed to have the same API as
scipysparse arrays.Added in version (cfdm): 1.11.0.0
Initialisation
- Parameters:
- array:
numpy.ndarray The numpy array.
- source: optional
Convert source, which can be any type of object, to a
SparseArrayinstance.All other parameters, apart from copy, are ignored and their values are instead inferred from source by assuming that it has the
SparseArrayAPI. Any parameters that can not be retrieved from source in this way are assumed to have their default value.Note that if
xis also aSparseArrayinstance thencfdm.SparseArray(source=x)is equivalent tox.copy().- copy:
bool, optional If True (the default) then deep copy the input parameters prior to initialisation. By default the parameters are not deep copied.
- array:
Methods¶
Methods
The |
|
Return an independent numpy array containing the data. |
|
Cast the data to a specified type. |
|
Return a deep copy of the array. |
|
Data-type of the array. |
|
The attributes of the array. |
|
The calendar of the array. |
|
Returns the array's compression type. |
|
The units of the array. |
|
Number of array dimensions. |
|
Shape of the array. |
|
Number of elements in the array. |
|
Return an independent |
|
Bring data on disk into memory. |