Table¤
Table ¤
Bases: ndarray
Represents the table element in an equipment register.
comment
class-attribute
instance-attribute
¤
comment: str = ''
A comment that is associated with the table.
header
class-attribute
instance-attribute
¤
The header value of each column.
types
class-attribute
instance-attribute
¤
The data type of each column.
units
class-attribute
instance-attribute
¤
The unit of each column.
__new__ ¤
__new__(
*,
types: NDArray[void],
units: NDArray[void],
header: NDArray[void],
data: ArrayLike,
comment: str = ""
) -> Table
Create a new Table instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
types
|
NDArray[void]
|
The data type of each column. |
required |
units
|
NDArray[void]
|
The unit of each column. |
required |
header
|
NDArray[void]
|
The header value of each column. |
required |
data
|
ArrayLike
|
The table data. |
required |
comment
|
str
|
A comment that is associated with the table. |
''
|
from_xml
classmethod
¤
Convert an XML element into a Table instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element
|
Element[str]
|
A table XML element from an equipment register. |
required |
Returns:
Type | Description |
---|---|
Table
|
A Table is an subclass of a numpy
structured array, where the |
to_xml ¤
unstructured ¤
unstructured(
*,
dtype: DTypeLike = None,
copy: bool = False,
casting: Literal[
"no", "equiv", "safe", "same_kind", "unsafe"
] = "unsafe"
) -> NDArray[Any]
Converts the structured array into an unstructured array.
If the table contains both numbers and strings, you may find that this method will fail.
See structured_to_unstructured for more details.
Warning
This returns a numpy ndarray instance (not a
Table instance). The header
, types
, units
and
comment
attributes are not included with the returned array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dtype
|
DTypeLike
|
The dtype of the output unstructured array. |
None
|
copy
|
bool
|
If |
False
|
casting
|
Literal['no', 'equiv', 'safe', 'same_kind', 'unsafe']
|
See casting argument of numpy.ndarray.astype. Controls what kind of data casting may occur. |
'unsafe'
|
Returns:
Type | Description |
---|---|
NDArray[Any]
|
The unstructured array. |