gwexpy.histogram.HistogramList
- class gwexpy.histogram.HistogramList(*items: _H | Iterable[_H])[source]
Bases:
ListMapMixin,HistogramBaseList[Histogram]A list of Histogram objects.
HistogramList provides a container for an ordered sequence of histograms, supporting batch processing.
- Parameters:
*items (Histogram or iterable of Histograms) – Initial items to populate the list.
Notes
Key mapping methods:
fill(*args, **kwargs)Fill each Histogram in the list with new data.
rebin(*args, **kwargs)Rebin each Histogram in the list.
mean(*args, **kwargs)Compute weighted mean of each Histogram.
Examples
>>> from gwexpy.histogram import Histogram, HistogramList >>> h = Histogram([1, 2], [0, 1, 2]) >>> hl = HistogramList([h]) >>> hl [<Histogram (nbins=2, unit=)>]
- __init__(*items: _H | Iterable[_H])
Methods
__init__(*items)append(item)Append one histogram and return
self.clear()Remove all items from list.
copy()Return a deep copy of the histogram list.
count(value, /)Return number of occurrences of value.
extend(items)Extend the list with validated histogram items.
fill(*args, **kwargs)Fill each Histogram in the list with new data.
index(value[, start, stop])Return first index of value.
insert(index, item)Insert one validated histogram at
index.max(*args, **kwargs)Compute upper edge of last non-zero bin for each Histogram.
mean(*args, **kwargs)Compute weighted mean of each Histogram.
median(*args, **kwargs)Compute median of each Histogram.
min(*args, **kwargs)Compute lower edge of first non-zero bin for each Histogram.
plot(**kwargs)Plot this collection using gwexpy Plot.
plot_all(*args, **kwargs)Alias for plot().
pop([index])Remove and return item at index (default last).
quantile(*args, **kwargs)Compute quantile of each Histogram.
read(source, *args, **kwargs)Read data into a HistogramList.
rebin(*args, **kwargs)Rebin each Histogram in the list.
remove(value, /)Remove first occurrence of value.
reverse()Reverse IN PLACE.
sort(*[, key, reverse])Sort the list in ascending order and return None.
std(*args, **kwargs)Compute weighted standard deviation of each Histogram.
to_density(*args, **kwargs)Convert each Histogram to density representation.
var(*args, **kwargs)Compute weighted variance of each Histogram.
write(target, *args, **kwargs)Write the histogram list to a supported target format.
- EntryClass
alias of
Histogram
- rebin(*args, **kwargs)
Rebin each Histogram in the list. Returns a HistogramList.
- fill(*args, **kwargs)
Fill each Histogram in the list with new data.
- to_density(*args, **kwargs)
Convert each Histogram to density representation. Returns a list of Quantities.
- mean(*args, **kwargs)
Compute weighted mean of each Histogram. Returns a list of Quantities.
- var(*args, **kwargs)
Compute weighted variance of each Histogram. Returns a list of Quantities.
- std(*args, **kwargs)
Compute weighted standard deviation of each Histogram. Returns a list of Quantities.
- median(*args, **kwargs)
Compute median of each Histogram. Returns a list of Quantities.
- quantile(*args, **kwargs)
Compute quantile of each Histogram. Returns a list of Quantities.
- min(*args, **kwargs)
Compute lower edge of first non-zero bin for each Histogram. Returns a list of Quantities.
- max(*args, **kwargs)
Compute upper edge of last non-zero bin for each Histogram. Returns a list of Quantities.