Loading...

verticapy.vDataFrame.boxplot#

vDataFrame.boxplot(columns: str | list[str] | None = None, q: tuple[float, float] = (0.25, 0.75), 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 input vDataColumns.

Parameters#

columns: SQLColumns, optional

List of the vDataColumns names. If empty, all numerical vDataColumns are used.

q: tuple, optional

Tuple including the 2 quantiles used to draw the BoxPlot.

max_nb_fliers: int, optional

Maximum number of points to use to represent the fliers of each category. Drawing fliers will slow 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),
        "score2": np.random.normal(8, 1.5, N),
        "score3": np.random.normal(10, 2, N),
    }
)

Below are examples of two types of boxplot:

  • Single (for one column)

  • Multi (for more than one column)

Check out the tabs below for specific examples.

data.boxplot(["score1"])
data.boxplot(columns = ["score1", "score2", "score3"])

See also

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