Loading...

verticapy.vDataColumn.boxplot#

vDataColumn.boxplot(by: str | None = None, q: tuple[float, float] = (0.25, 0.75), h: int | float | Decimal = 0, max_cardinality: int = 8, cat_priority: None | bool | float | str | timedelta | datetime | list | ndarray = None, max_nb_fliers: int = 30, whis: float = 1.5, chart: PlottingBase | TableSample | Axes | mFigure | Highchart | Highstock | Figure | None = None, **style_kwargs) PlottingBase | TableSample | Axes | mFigure | Highchart | Highstock | Figure#

Draws the box plot of the vDataColumn.

Parameters#

by: str, optional

vDataColumn 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’ vDataColumn 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 vDataColumn 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#

obj

Plotting Object.

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 VerticaPy.

import verticapy as vp

Let’s also import numpy to create a dataset.

import numpy as np

We can create a variable N to fix the size:

N = 50

Let’s generate a dataset using the following data.

data = vp.vDataFrame(
    {
        "score1": np.random.normal(5, 1, N),
    }
)

Now we are ready to draw the plot:

data["score1"].boxplot()

See also

vDataFrame.boxplot() : Box Plot.
vDataColumn.outliers_plot() : Outliers Plot.