54 template<
typename dtype>
63 std::vector<dtype> values;
64 for (
auto value : inArray)
68 values.push_back(value);
72 const uint32 middle =
static_cast<uint32>(values.size()) / 2;
82 for (
uint32 row = 0; row < inShape.
rows; ++row)
84 std::vector<dtype> values;
85 for (
uint32 col = 0; col < inShape.
cols; ++col)
89 values.push_back(inArray(row, col));
93 const uint32 middle =
static_cast<uint32>(values.size()) / 2;
95 returnArray(0, row) = values[middle];
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:37
#define STATIC_ASSERT_FLOAT(dtype)
Definition: StaticAsserts.hpp:50
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:139
self_type transpose() const
Definition: NdArrayCore.hpp:4882
const Shape & shape() const noexcept
Definition: NdArrayCore.hpp:4511
A Shape Class for NdArrays.
Definition: Core/Shape.hpp:41
uint32 rows
Definition: Core/Shape.hpp:44
uint32 cols
Definition: Core/Shape.hpp:45
void nth_element(RandomIt first, RandomIt nth, RandomIt last) noexcept
Definition: StlAlgorithms.hpp:425
Definition: Cartesian.hpp:40
Axis
Enum To describe an axis.
Definition: Enums.hpp:36
bool isnan(dtype inValue) noexcept
Definition: isnan.hpp:49
NdArray< dtype > nanmedian(const NdArray< dtype > &inArray, Axis inAxis=Axis::NONE)
Definition: nanmedian.hpp:55
std::uint32_t uint32
Definition: Types.hpp:40