xnpy: read/write NPY files

Defined in xtensor/xnpy.hpp

template<typename T, layout_type L = layout_type::dynamic>
auto xt::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>
void xt::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 data

  • e: the xexpression