Defined as:
sdynpy.core.sdynpy_array.SdynpyArrayModule:
sdynpy.core.sdynpy_arraySource: GitHub
Parent:
numpy.ndarray
Signature¶
class sdynpy.SdynpyArray(shape, dtype=<class 'float'>, buffer=None, offset=0, strides=None, order=None)Superclass of the core SDynPy objects
The core SDynPy object arrays inherit from this class. The class is a subclass of numpy’s ndarray. The underlying data structure is stored as a structured array, but the class’s implementation allows accessing the array fields as if they were attributes.
Attributes¶
| Name | Summary |
|---|---|
fields | Returns the fields of the structured array. |
fields¶
Returns the fields of the structured array.
These fields can be accessed through attribute syntax.
Methods¶
| Name | Summary |
|---|---|
assemble_mat_dict | Assembles a dictionary of fields |
load | Load in the specified file into a SDynPy array object |
ndenumerate | Enumerates over all entries in the array |
save | Save the array to a numpy file |
savemat | Save array to a Matlab *.mat file. |
assemble_mat_dict¶
Source: GitHub
def sdynpy.SdynpyArray.assemble_mat_dict(self)Assembles a dictionary of fields
Returns¶
output_dict : dict A dictionary of contents of the file
load¶
Source: GitHub
def sdynpy.SdynpyArray.load(cls, filename)Load in the specified file into a SDynPy array object
Parameters¶
filename : str Filename specifying the file to load. If the filename has extension .unv or .uff, it will be loaded as a universal file. Otherwise, it will be loaded as a NumPy file.
Returns¶
cls
SDynpy array of the appropriate type from the loaded file.
Raises¶
AttributeError
Raised if a unv file is loaded from a class that does not have a
from_unv attribute defined.
ndenumerate¶
Source: GitHub
def sdynpy.SdynpyArray.ndenumerate(self)Enumerates over all entries in the array
Yields¶
tuple
indices corresponding to each entry in the array
array
entry in the array corresponding to the index
save¶
Source: GitHub
def sdynpy.SdynpyArray.save(self, filename: str)Save the array to a numpy file
Parameters¶
filename : str Filename that the array will be saved to. Will be appended with .npy if not specified in the filename
savemat¶
Source: GitHub
def sdynpy.SdynpyArray.savemat(self, filename)Save array to a Matlab *.mat file.
Parameters¶
filename : str Name of the file in which the data will be saved
Returns¶
None.