MCPcopy Create free account
hub / github.com/apache/datafusion / median

Method median

datafusion/expr-common/src/statistics.rs:143–151  ·  view source on GitHub ↗

Extracts the median value of this uncertain quantity, depending on its distribution: - A [`Uniform`] distribution's interval determines its median value, which is the arithmetic average of the interval endpoints. - An [`Exponential`] distribution's median is calculable by the formula `offset + ln(2) / λ`, where `λ` is the (non-negative) rate. - A [`Gaussian`] distribution's median is equal to its

(&self)

Source from the content-addressed store, hash-verified

141 /// - A [`Generic`] distribution _may_ have it explicitly, or this information
142 /// may be absent.
143 pub fn median(&self) -> Result<ScalarValue> {
144 match &self {
145 Uniform(u) => u.median(),
146 Exponential(e) => e.median(),
147 Gaussian(g) => Ok(g.median().clone()),
148 Bernoulli(b) => b.median(),
149 Generic(u) => Ok(u.median().clone()),
150 }
151 }
152
153 /// Extracts the variance value of this uncertain quantity, depending on
154 /// its distribution:

Callers 3

evaluate_statisticsMethod · 0.80
compute_medianFunction · 0.80
try_fromMethod · 0.80

Calls 9

add_checkedMethod · 0.80
sub_checkedMethod · 0.80
cloneMethod · 0.45
meanMethod · 0.45
cast_toMethod · 0.45
data_typeMethod · 0.45
divMethod · 0.45
is_nullMethod · 0.45
ltMethod · 0.45

Tested by

no test coverage detected