vastorbit.VastColumn.boxplot¶
- VastColumn.boxplot(by: str | None = None, q: tuple[float, float] = (0.25, 0.75), h: Annotated[int | float | Decimal, 'Python Numbers'] = 0, max_cardinality: int = 8, cat_priority: None | Annotated[bool | float | str | timedelta | datetime, 'Python Scalar'] | Annotated[list | ndarray, 'Array Like Structure'] = None, max_nb_fliers: int = 30, whis: float = 1.5, chart: PlottingBase | TableSample | Axes | mFigure | Figure | None = None, **style_kwargs) PlottingBase | TableSample | Axes | mFigure | Figure¶
Draws the box plot of the VastColumn.
- Parameters:
by (str, optional) – VastColumn used to partition the data.
q (tuple, optional) – Tuple including the 2 quantiles used to draw the BoxPlot.
h (PythonNumber, optional) – Interval width if the ‘by’ VastColumn is numerical or of a date-like type. Optimized h will be computed if the parameter is empty or invalid.
max_cardinality (int, optional) – Maximum number of distinct VastColumn elements to be used as categorical. The less frequent elements are gathered together to create a new category : ‘Others’.
cat_priority (PythonScalar / ArrayLike, optional) – ArrayLike list of the different categories to consider when drawing the box plot. The other categories are filtered.
max_nb_fliers (int, optional) – Maximum number of points used to represent the fliers of each category. Drawing fliers slows down the graphic computation.
whis (float, optional) – The position of the whiskers.
chart (PlottingObject, optional) – The chart object to plot on.
**style_kwargs – Any optional parameter to pass to the plotting functions.
- Returns:
Plotting Object.
- Return type:
obj
Examples
Note
The below example is a very basic one. For other more detailed examples and customization options, please see Boxplot
Let’s begin by importing vastorbit.
import vastorbit as vo
Let’s also import numpy to create a dataset.
import numpy as np
We can create a variable
Nto fix the size:N = 50
Let’s generate a dataset using the following data.
data = vo.VastFrame( { "score1": np.random.normal(5, 1, N), } )
Now we are ready to draw the plot:
data["score1"].boxplot()
See also
VastFrame.boxplot(): Box Plot.VastColumn.outliers_plot(): Outliers Plot.