Transform plotter
daspi.plotlib.plotter.TransformPlotter(source, target, feature='', f_base=DEFAULT.FEATURE_BASE, skip_na=None, target_on_y=True, color=None, ax=None, visible_spines=None, hide_axis=None, **kwds)
¶
Bases: Plotter
Abstract base class for creating plotters.
| PARAMETER | DESCRIPTION |
|---|---|
source
|
Pandas long format DataFrame containing the data source for the plot.
TYPE:
|
target
|
Column name of the target variable for the plot.
TYPE:
|
feature
|
Column name of the feature variable for the plot, by default ''
TYPE:
|
f_base
|
Value that serves as the base location (offset) of the
feature values. Only taken into account if feature is not
given, by default
TYPE:
|
skip_na
|
Flag indicating whether to skip missing values in the feature grouped data, by default None - None, no missing values are skipped - all', grouped data is skipped if all values are missing - any', grouped data is skipped if any value is missing
TYPE:
|
target_on_y
|
Flag indicating whether the target variable is plotted on the y-axis, by default True
TYPE:
|
color
|
Color to be used to draw the artists. If None, the first color is taken from the color cycle, by default None.
TYPE:
|
ax
|
The axes object for the plot. If None, the current axes is
fetched using
TYPE:
|
visible_spines
|
Specifies which spines are visible, the others are hidden. If 'none', no spines are visible. If None, the spines are drawn according to the stylesheet. Defaults to None.
TYPE:
|
hide_axis
|
Specifies which axes should be hidden. If None, both axes are displayed. Defaults to None.
TYPE:
|
**kwds
|
Those arguments have no effect. Only serves to catch further arguments that have no use here (occurs when this class is used within chart objects).
DEFAULT:
|
skip_na = skip_na
instance-attribute
¶
Flag indicating whether to skip missing values in the feature
grouped data.
- None: no missing values are skipped
- 'all': grouped data is skipped if all values are missing
- 'any': grouped data is skipped if any value is missing
feature_grouped(source)
¶
Group the data by the feature variable and yield the transformed data for each group.
| PARAMETER | DESCRIPTION |
|---|---|
source
|
Pandas long format DataFrame containing the data source for the plot.
TYPE:
|
| YIELDS | DESCRIPTION |
|---|---|
feature_data
|
Base location (offset) of feature axis.
TYPE::
|
target_data
|
feature grouped target data used for transformation.
TYPE::
|
transform(feature_data, target_data)
abstractmethod
¶
Perform the transformation on the target data and return the transformed data.
This method should be overridden by subclasses to provide the specific plotting functionality.
| PARAMETER | DESCRIPTION |
|---|---|
feature_data
|
Base location (offset) of feature axis coming from `feature_grouped' generator.
TYPE:
|
target_data
|
feature grouped target data used for transformation, coming from `feature_grouped' generator.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
data
|
The transformed data source for the plot.
TYPE:
|