xnpy: read/write NPY files¶
Defined in xtensor/xnpy.hpp
-
template<typename
T, layout_typeL= layout_type::dynamic>
autoxt::load_npy(std::istream &stream)¶ Loads a npy file (the numpy storage format)
- Return
xarray with contents from npy file
- Parameters
stream: An input stream from which to load the file
- Template Parameters
T: select the type of the npy file (note: currently there is no dynamic casting if types do not match)L: select layout_type::column_major if you stored data in Fortran format
-
template<typename
T, layout_typeL= layout_type::dynamic>
autoxt::load_npy(const std::string &filename)¶ Loads a npy file (the numpy storage format)
- Return
xarray with contents from npy file
- Parameters
filename: The filename or path to the file
- Template Parameters
T: select the type of the npy file (note: currently there is no dynamic casting if types do not match)L: select layout_type::column_major if you stored data in Fortran format
-
template<typename
E>
voidxt::dump_npy(const std::string &filename, const xexpression<E> &e)¶ Save xexpression to NumPy npy format.
- Parameters
filename: The filename or path to dump the datae: the xexpression
-
template<typename
E>
std::stringxt::dump_npy(const xexpression<E> &e)¶ Save xexpression to NumPy npy format in a string.
- Parameters
e: the xexpression