StructuredTypeArray
Represents an array of objects defined by the StructuredType spec provided mostly useful as it dispatches to NumPy where things are simple enough to do so
It has a system to dispatch intelligently based on the type of array provided The kinds of structures supported are: OrderedDict, list, and np.ndarray
A simple StructuredTypeArray is one that can just be represented as a single np.ndarray A compound StructuredTypeArray requires either a list or OrderedDict of StructuredTypeArray subarrays
Properties and Methods
__init__(self, stype, num_elements=50, padding_mode='fill', padding_value=None):
stype
:StructuredType
No description…
num_elements
:int
number of default elements in dynamically sized arrays
@property
is_simple(self):
Just returns wheter the core datatype is simple
:returns
:_
No description…
@property
dict_like(self):
@property
extension_axis(self):
Determines which axis to extend when adding more memory to the array
:returns
:_
No description…
@property
shape(self):
@property
block_size(self):
@property
append_depth(self):
@property
dtype(self):
Returns the core data type held by the StructuredType that represents the array
:returns
:_
No description…
@property
stype(self):
Returns the StructuredType that the array holds data for
:returns
:_
No description…
@property
array(self):
axis_shape_indeterminate(self, axis):
Tries to determine if an axis has had any data placed into it or otherwise been given a determined shape
axis
:Any
No description…
:returns
:_
No description…
@property
has_indeterminate_shape(self):
Tries to determine if the entire array has a determined shape
axis
:Any
No description…
:returns
:_
No description…
@property
filled_to(self):
set_filling(self, amt, axis=0):
increment_filling(self, inc=1, axis=0):
__len__(self):
empty_array(self, shape=None, num_elements=None):
Creates empty arrays with (potentially) default elements
The shape handling rules operate like this:
if shape is None, we assume we'll initialize this as an array with a single element to be filled out
if shape is (None,) or (n,) we'll initialize this as an array with multiple elments to be filled out
otherwise we'll just take the specified shape - `num_elements`: `Any`
>No description... - `:returns`: `_`
>No description...
extend_array(self, axis=None):
__setitem__(self, key, value):
set_part(self, key, value):
Recursively sets parts of an array if not simple, otherwise just delegates to NumPy
key
:Any
No description…
value
:Any
No description…
:returns
:_
No description…
__getitem__(self, item):
get_part(self, item, use_full_array=True):
If simple, delegates to NumPy, otherwise tries to recursively get parts…? Unclear how slicing is best handled here.
item
:Any
No description…
:returns
:_
No description…
add_axis(self, which=0, num_elements=None, change_shape=True):
Adds an axis to the array, generally used for expanding from singular or 1D data to higher dimensional This happens with parse_all and repeated things like that
which
:Any
No description…
num_elements
:Any
No description…
:returns
:_
No description…
can_cast(self, val):
Determines whether val can probably be cast to the right return type and shape without further processing or if that’s definitely not possible
val
:Any
No description…
:returns
:_
No description…
append(self, val, axis=0):
Puts val in the first empty slot in the array
val
:Any
No description…
:returns
:_
No description…
extend(self, val, single=True, prepend=False, axis=None):
Adds the sequence val to the array
val
:Any
No description…
single
:bool
a flag that indicates whether val can be treated as a single object or if it needs to be reshapen when handling in non-simple case
:returns
:_
No description…
fill(self, array):
Sets the result array to be the passed array
array
:str | np.ndarray
No description…
:returns
:_
No description…
cast_to_array(self, txt):
Casts a string of things with a given data type to an array of that type and does some optional shape coercion
txt
:str | iterable[str]
No description…
:returns
:_
No description…
__repr__(self):
Examples
Edit Examples or
Create New Examples
Edit Template or
Create New Template
Edit Docstrings