pyarray
-
template<class T, layout_type L>
class pyarray : public xt::pycontainer<pyarray<T, L>>, public xcontainer_semantic<pyarray<T, L>> Multidimensional container providing the xtensor container semantics to a numpy array.
pyarray is similar to the xarray container in that it has a dynamic dimensionality. Reshapes of a pyarray container are reflected in the underlying numpy array.
See also
- Template Parameters:
T – The type of the element stored in the pyarray.
L – Static layout of the pyarray
Constructors
-
inline pyarray(const value_type &t)
Allocates a pyarray with nested initializer lists.
-
inline explicit pyarray(const shape_type &shape, layout_type l = layout_type::row_major)
Allocates an uninitialized pyarray with the specified shape and layout.
- Parameters:
shape – the shape of the pyarray
l – the layout of the pyarray
-
inline explicit pyarray(const shape_type &shape, const_reference value, layout_type l = layout_type::row_major)
Allocates a pyarray with the specified shape and layout.
Elements are initialized to the specified value.
- Parameters:
shape – the shape of the pyarray
value – the value of the elements
l – the layout of the pyarray
-
inline explicit pyarray(const shape_type &shape, const strides_type &strides, const_reference value)
Allocates an uninitialized pyarray with the specified shape and strides.
Elements are initialized to the specified value.
- Parameters:
shape – the shape of the pyarray
strides – the strides of the pyarray
value – the value of the elements
-
inline explicit pyarray(const shape_type &shape, const strides_type &strides)
Allocates an uninitialized pyarray with the specified shape and strides.
- Parameters:
shape – the shape of the pyarray
strides – the strides of the pyarray