NumCpp  2.1.0
A C++ implementation of the Python Numpy library
replace.hpp
Go to the documentation of this file.
1 #pragma once
30 
31 #include "NumCpp/NdArray.hpp"
32 
33 namespace nc
34 {
35  //============================================================================
36  // Method Description:
45  template<typename dtype>
46  NdArray<dtype> replace(const NdArray<dtype>& inArray, dtype oldValue, dtype newValue)
47  {
48  auto returnArray = inArray.copy();
49  returnArray.replace(oldValue, newValue);
50  return returnArray;
51  }
52 } // namespace nc
nc::NdArray::copy
NdArray< dtype > copy() const
Definition: NdArrayCore.hpp:2397
nc::replace
NdArray< dtype > replace(const NdArray< dtype > &inArray, dtype oldValue, dtype newValue)
Definition: replace.hpp:46
nc::NdArray< dtype >
NdArray.hpp
nc
Definition: Coordinate.hpp:45
nc::NdArray::replace
void replace(value_type oldValue, value_type newValue)
Definition: NdArrayCore.hpp:4071