So, I assume that everyone is aware of the terms “mean” and “median” and how they apply to statistics. But what if I asked you, “**What should we choose between both of them in data science when facing different types of datasets**”.

In data science, selecting the appropriate measure of central tendency is crucial when summarising a dataset. The mean and the median are the two most widely used metrics for assessing central tendency. The decision to choose the mean or the median depends on the type of data and the purpose of the analysis, even if both of these metrics are useful for understanding the dataset.

In data science, the mean is the most widely used indicator of central tendency. By adding together all the values in a dataset and dividing by the total number of observations, it is determined. When the data is symmetrical or regularly distributed, the mean is an effective indicator of central tendency.

**For example:-** if we want to know the average age of a group of people, we would calculate the mean age by adding up all the ages and dividing by the number of people in the group.

Extreme values also referred to as outliers, can, however, have an impact on the mean. Outliers are observations that stand out from the rest of the dataset in a significant way. The mean may not be a reliable indicator of central tendency when outliers are present since it can be affected by extreme numbers.

Another central tendency measure used in data science is the median. When values are ordered in order of magnitude, this value is in the middle of the dataset. In cases where the data is skewed or involves extreme values, the median serves as a reliable indicator of central tendency.

**For example**:- if we want to know the typical salary of a group of employees, we would calculate the median salary by arranging all the salaries in order and finding the middle value.

When the data is skewed or has extreme values, the median is a useful indicator of central tendency since it is less impacted by extreme values than the mean. Also, because it is a reliable indicator of central tendency, it is unaffected by minor variations in the data.

The choice between using mean or median depends on the nature of the data and the research question. Here are some guidelines to help choose the appropriate measure of central tendency:

**Use Mean —**

- The data is normally distributed or symmetric
- There are no outliers or extreme values in the dataset
- The research question requires a measure of central tendency that reflects the average value of the dataset.

**Use Median —**

- The data is skewed or has extreme values
- There are outliers or extreme values in the dataset
- The research question requires a measure of central tendency that reflects the typical or central value of the dataset.

It’s also important to note that other measures of central tendencies, such as mode or geometric mean, may be appropriate for certain types of data. Therefore, it’s always important to consider the nature of the data and the research question when choosing a measure of central tendency.

Choosing the right central tendency measure is crucial when summarising a dataset, to wrap up. When the data is evenly distributed or symmetrical, the mean is a good indicator of central tendency. however, when the data is skewed or contains extreme values, the median is a better indicator of central tendency. We can select the right measure of central tendency to get insightful knowledge about the dataset by comprehending the nature of the data and the research topic.