55 template<
typename dtype>
64 std::vector<dtype> values;
65 for (
auto value : inArray)
69 values.push_back(value);
73 const uint32 middle =
static_cast<uint32>(values.size()) / 2;
83 for (
uint32 row = 0; row < inShape.
rows; ++row)
85 std::vector<dtype> values;
86 for (
uint32 col = 0; col < inShape.
cols; ++col)
90 values.push_back(inArray(row, col));
94 const uint32 middle =
static_cast<uint32>(values.size()) / 2;
96 returnArray(0, row) = values[middle];
104 const Shape inShape = transposedArray.
shape();
106 for (
uint32 row = 0; row < inShape.
rows; ++row)
108 std::vector<dtype> values;
109 for (
uint32 col = 0; col < inShape.
cols; ++col)
113 values.push_back(transposedArray(row, col));
117 const uint32 middle =
static_cast<uint32>(values.size()) / 2;
119 returnArray(0, row) = values[middle];
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:36
#define STATIC_ASSERT_FLOAT(dtype)
Definition: StaticAsserts.hpp:43
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:72
Shape shape() const noexcept
Definition: NdArrayCore.hpp:4483
NdArray< dtype > transpose() const
Definition: NdArrayCore.hpp:4830
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:397
Definition: Coordinate.hpp:45
Axis
Enum To describe an axis.
Definition: Types.hpp:46
NdArray< dtype > nanmedian(const NdArray< dtype > &inArray, Axis inAxis=Axis::NONE)
Definition: nanmedian.hpp:56
bool isnan(dtype inValue) noexcept
Definition: isnan.hpp:51
std::uint32_t uint32
Definition: Types.hpp:40