NumCpp  2.12.1
A Templatized Header Only C++ Implementation of the Python NumPy Library
replace.hpp
Go to the documentation of this file.
1
28#pragma once
29
30#include "NumCpp/NdArray.hpp"
31
32namespace nc
33{
34 //============================================================================
35 // Method Description:
44 template<typename dtype>
45 NdArray<dtype> replace(const NdArray<dtype>& inArray, dtype oldValue, dtype newValue)
46 {
47 auto returnArray = inArray.copy();
48 returnArray.replace(oldValue, newValue);
49 return returnArray;
50 }
51} // namespace nc
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:139
self_type & replace(value_type oldValue, value_type newValue)
Definition: NdArrayCore.hpp:4248
self_type copy() const
Definition: NdArrayCore.hpp:2486
Definition: Cartesian.hpp:40
NdArray< dtype > replace(const NdArray< dtype > &inArray, dtype oldValue, dtype newValue)
Definition: replace.hpp:45