Online Learning Platform

Data Analysis Using Python > Descriptive Statistics > Measures of Location

Calculation Mean, Median and Mode of continuous data

If you already installed python in your pc then run jupyter and  your data file are in a directory/folder: i.e. /Users/mdfazlulkarimpatwary/Documents/Lectures/data Analysis Python/employees.xlsx

 
Then the following codes:
import pandas as pd

df = pd.read_excel("/Users/mdfazlulkarimpatwary/Documents/Lectures/data Analysis Python/employees.xlsx")

print(df.head())

 

import pandas as pd

mean_height = df['Height'].mean()

median_height = df['Height'].median()

mode_height = df['Height'].mode()

print("Mean :", mean_height)
print("Median :", median_height)
print("Mode :", list(mode_height))

 
Output:
Mean : 67.967
Median : 68.0
Mode : [58, 76]
 

Prev
Density curve for continuous data
Next
Measures of Dispersion
Feedback
ABOUT

Statlearner


Statlearner STUDY

Statlearner