0% found this document useful (0 votes)
15 views2 pages

Descriptive Statistics in Python

The document provides an overview of descriptive statistics including mean, median, standard deviation, min and max, count, skewness, and kurtosis, along with Python examples for each concept. Mean is used for symmetric data, while median is preferred for skewed data. The document emphasizes the importance of these statistics in understanding data distributions and identifying outliers.

Uploaded by

Areesha Khan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views2 pages

Descriptive Statistics in Python

The document provides an overview of descriptive statistics including mean, median, standard deviation, min and max, count, skewness, and kurtosis, along with Python examples for each concept. Mean is used for symmetric data, while median is preferred for skewed data. The document emphasizes the importance of these statistics in understanding data distributions and identifying outliers.

Uploaded by

Areesha Khan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Descriptive Statistics with Interview

Answers & Python Examples


1. Mean (Average)
Mean is the average of all values. Use it when data is symmetric without outliers.

Python Example:

import numpy as np

data = [30000, 35000, 38000, 40000, 5000000]


mean_value = [Link](data)
print("Mean:", mean_value)

2. Median
Median is the middle value. Use it when data is skewed or has outliers.

Python Example:

median_value = [Link](data)
print("Median:", median_value)

3. Standard Deviation
Standard deviation shows how spread out the values are from the mean.

Python Example:

std_value = [Link](data)
print("Standard Deviation:", std_value)

4. Min and Max


Minimum and maximum help in identifying range and outliers.

Python Example:

min_val = [Link](data)
max_val = [Link](data)
print("Min:", min_val, "Max:", max_val)
5. Count
Count tells how many non-null entries exist in the dataset.

Python Example:

import pandas as pd
df = [Link]({"values": data})
print("Count:", df['values'].count())

6. Skewness
Skewness indicates the asymmetry of the data distribution.

Python Example:

print("Skewness:", df['values'].skew())

7. Kurtosis
Kurtosis tells how heavy the tails of a distribution are.

Python Example:

print("Kurtosis:", df['values'].kurt())

Common questions

Powered by AI

Skewness measures the asymmetry of the data distribution. A skewness value close to zero suggests a symmetric distribution, while positive or negative values indicate right or left skew. Kurtosis, on the other hand, measures the 'tailedness' of the distribution. High kurtosis means more data in the tails and sharper peaks (leptokurtic), while low kurtosis indicates flatter distributions (platykurtic). Together, these statistics provide insights into the shape and tendencies of a dataset's distribution .

Mean provides an overview of average salaries, but can be skewed by high executive pay. Median offers a more robust central tendency measure unaffected by outliers, indicating typical employee earnings. Standard deviation shows salary variation, indicating disparities in compensation levels. Together, these statistics help assess equity, detect outliers (e.g., unusually high top management salaries), and plan compensation strategies .

The count function can identify null data entries by revealing how many non-null entries exist, indirectly showing the missing values by comparing with the expected count. An analyst might subtract the count of non-null values from the total rows to determine the number of null entries .

Standard deviation is crucial as it quantifies the amount of variation or dispersion in a dataset. It helps determine how spread out the values are from the mean, providing insights into the consistency of the data. A low standard deviation indicates that the values tend to be close to the mean, while a high standard deviation suggests greater variability .

Extreme outliers affect the calculated mean because they are included in the sum of all values, thus altering the average significantly, especially in small datasets. On the other hand, the median, being the middle value, remains unaffected by extremes because it doesn't change unless outliers shift the middle position of the dataset .

A data analyst uses skewness to assess data symmetry. If data is skewed, non-parametric methods might be more appropriate, or transformations could be used to achieve normality, crucial for parametric tests. This assessment helps in selecting correct modeling techniques and hypothesis tests, tailored to data characteristics .

While skewness addresses asymmetry and standard deviation focuses on dispersion, kurtosis provides insights into the dataset's tail distribution. It helps identify outliers and extreme deviations through tail analysis and whether these occurrences are frequent, which neither skewness nor standard deviation directly assess .

Using the count function is essential when verifying the completeness of data in a dataset. For example, in a customer database, using count can confirm how many entries have been logged versus expected entries, helping identify missing data points or entry errors .

The minimum and maximum values can identify outliers and range, but they don't provide information about distribution shapes or variability. They focus only on the extremes, ignoring other distribution aspects such as central tendency and spread, which can lead to inadequate conclusions about the dataset .

In datasets with significant outliers, the mean can be highly affected, giving a distorted view of central tendency. In contrast, the median remains robust as it is the middle value and is not influenced by extreme values. Thus, the median is often preferred over the mean for such datasets to provide a more accurate representation of the data's central tendency .

You might also like