xtensor provides the following functions that deal with NaNs in xexpressions:
Defined in xtensor/xmath.hpp
.. doxygenfunction:: nan_to_num(E&&) :project: xtensor
.. doxygenfunction:: nansum(E&&, X&&, EVS) :project: xtensor
.. doxygenfunction:: nanprod(E&&, X&&, EVS) :project: xtensor
.. doxygenfunction:: nancumsum(E&&) :project: xtensor
.. doxygenfunction:: nancumsum(E&&, std::ptrdiff_t) :project: xtensor
.. doxygenfunction:: nancumprod(E&&) :project: xtensor
.. doxygenfunction:: nancumprod(E&&, std::ptrdiff_t) :project: xtensor