Skip to content

get_weighted_five_number_summary()

get_weighted_five_number_summary() computes a weighted five-number summary: min, Q1, median, Q3, and max.

Function Usage

python
from sequenzo import get_weighted_five_number_summary
summary = get_weighted_five_number_summary(values, weights=None, remove_missing=True)

Entry Parameters

ParameterRequiredTypeDescription
valuesarray-likeNumeric values to summarize.
weightsarray-like or NoneOptional weights. If None, all values are equally weighted.
remove_missingboolIf True, remove missing values before computing.

What It Does

  • Validates inputs and aligns values and weights.
  • Optionally removes missing values.
  • Computes weighted quantiles and returns a five-number summary array in the order: min, Q1, median, Q3, max.

Returns

np.ndarray.

Examples

python
from sequenzo import get_weighted_five_number_summary

values = [2, 4, 8, 10]
weights = [1, 1, 2, 1]

summary = get_weighted_five_number_summary(values, weights=weights)
print(summary)

R Counterpart

  • Closest R counterpart: No TraMineR public function. Use a weighted-quantile helper in R when you need a weighted five-number summary.
  • Mapping note: Sequenzo exposes this as a documented Python helper for weighted descriptive summaries, not as a TraMineR public API wrapper.

Notes

  • This is a general weighted descriptive statistics function.
  • It is not specific to TraMineR, but is useful in sequence-analysis summaries.

See Also

Authors

Code: Yuqi Liang

Documentation: Yuqi Liang

Sequenzo is released under the BSD-3-Clause License; this documentation site source is licensed under MIT.