NumCpp  2.8.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
replace.hpp
Go to the documentation of this file.
1 #pragma once
29 
30 #include "NumCpp/NdArray.hpp"
31 
32 namespace 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:72
NdArray< dtype > copy() const
Definition: NdArrayCore.hpp:2382
Definition: Coordinate.hpp:45
NdArray< dtype > replace(const NdArray< dtype > &inArray, dtype oldValue, dtype newValue)
Definition: replace.hpp:45