verticapy.vDataFrame.skewness#
- vDataFrame.skewness(columns: str | list[str] | None = None, **agg_kwargs) TableSample #
Utilizes the
skewness
aggregation method to analyze and aggregate the vDataFrame. Skewness, a measure of the asymmetry in the data’s distribution, helps us understand the data’s deviation from a perfectly symmetrical distribution. When we aggregate the vDataFrame using skewness, we gain insights into the data’s tendency to be skewed to the left or right, or if it follows a normal distribution.Warning
To compute skewness, VerticaPy needs to execute multiple queries. It necessitates, at a minimum, a query that includes a subquery to perform this type of aggregation. This complexity is the reason why calculating skewness is typically slower than some other types of aggregations.
Parameters#
- columns: SQLColumns, optional
List of the vDataColumns names. If empty, all numerical vDataColumns are used.
- **agg_kwargs
Any optional parameter to pass to the Aggregate function.
Returns#
- TableSample
result.
Examples#
For this example, we will use the following dataset:
import verticapy as vp data = vp.vDataFrame( { "x": [1, 2, 4, 9, 10, 15, 20, 22], "y": [1, 2, 1, 2, 1, 1, 2, 1], "z": [10, 12, 2, 1, 9, 8, 1, 3], } )
Now, let’s calculate the skewness for specific columns.
data.skewness( columns = ["x", "y", "z"], )
skewness "x" 0.328467287554527 "y" 0.644061188719529 "z" 0.168607546065438 Note
All the calculations are pushed to the database.
Hint
For more precise control, please refer to the
aggregate
method.See also
vDataColumn.
kurtosis()
: Kurtosis for a specific column.vDataColumn.
skewness()
: Skewness for a specific column.vDataFrame.
std()
: Standard Deviation for particular columns.