Skip to content

Calculations

Japip edited this page Oct 18, 2024 · 2 revisions

Calculations Module

The Calculations module provides a set of static methods for performing various statistical analyses on datasets. The Describe class within this module offers methods to calculate essential descriptive statistics, such as mean, variance, standard deviation, skewness, kurtosis, and median.

Class: Describe

The Describe class contains the following static methods:

1. Mean

@staticmethod
def mean(dataset)

Calculates the arithmetic mean of a given dataset.

Parameters:

  • dataset: A list of numeric values.

Returns:

  • The mean of the dataset as a float.

2. Variance

@staticmethod
def variance(dataset, mean)

Calculates the variance of a given dataset.

Parameters:

  • dataset: A list of numeric values.
  • mean: The mean of the dataset.

Returns:

  • The variance of the dataset as a float.

3. Standard Deviation

@staticmethod
def standard_deviation(variance)

Calculates the standard deviation from the variance.

Parameters:

  • variance: The variance of the dataset.

Returns:

  • The standard deviation as a float.

4. Skewness

@staticmethod
def skewness(dataset, mean, deviation)

Calculates the skewness of a given dataset, which measures the asymmetry of the distribution.

Parameters:

  • dataset: A list of numeric values.
  • mean: The mean of the dataset.
  • deviation: The standard deviation of the dataset.

Returns:

  • The skewness as a float.

5. Kurtosis

@staticmethod
def kurtosis(dataset, mean, deviation)

Calculates the kurtosis of a given dataset, which measures the "tailedness" of the distribution.

Parameters:

  • dataset: A list of numeric values.
  • mean: The mean of the dataset.
  • deviation: The standard deviation of the dataset.

Returns:

  • The kurtosis as a float.

6. Median

@staticmethod
def median(dataset)

Calculates the median value of a given dataset.

Parameters:

  • dataset: A list of numeric values.

Returns:

  • The median of the dataset as a float.

Usage

This module is designed for easy integration into data analysis workflows, allowing users to obtain critical statistical insights with minimal effort. Simply import the Describe class and utilize the static methods to analyze your datasets effectively.

Clone this wiki locally