graphical.data
bands
bands(data, num_bands, value_range=None)
Split data into bands.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Sequence[float]
|
Data to split into bands. |
required |
|
int
|
Number of bands. |
required |
|
Tuple[float, float]
|
Lower and upper boundary. Defaults to range of data. |
None
|
Returns:
| Type | Description |
|---|---|
List[Tuple[int, float]]
|
List[Tuple[int, float]]: List of tuples (band index, value). |
bins
bins(data, num_bins, *, summary_function=mean, spread=True)
Resample data into num_bins bins.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Sequence[float]
|
Data to resample. |
required |
|
int
|
Number of bins |
required |
|
SummaryFunction
|
Function to summarize the data in each bin. Defaults to |
mean
|
|
bool
|
Fill in values if |
True
|
Yields:
| Type | Description |
|---|---|
float
|
Binned data. |
normalize
normalize(data, value_range, clip=True)
Normalize data to value_range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Sequence[float]
|
Data to normalize. |
required |
|
Tuple[float, float]
|
Value range to normalize to. |
required |
|
bool
|
Clip out of range values. Defaults to True. |
True
|
Yields:
| Type | Description |
|---|---|
float
|
Normalized data. |
pairs
pairs(data)
Group data in pairs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Sequence[T]
|
Data to group in pairs. |
required |
Returns:
| Type | Description |
|---|---|
Iterable[Tuple[T, T]]
|
Iterable[Tuple[T, T]]: Data in pairs |