Aiml Exp 3.1 Mean Median
Aiml Exp 3.1 Mean Median
EXPERIMENT: 3.1
Aim: Write a python program to compute Mean, Median, Mode, Variance and Standard
Deviation using Datasets.
Theory:
Mean: The average of a set of numbers calculated by adding them together and dividing by
the count of numbers.
Median: The middle value in a set of data when arranged in ascending order, or the average
of the two middle values for an even number of elements.
Mode: The value that appears most frequently in a set of data.
Variance: A measure of the spread or dispersion of values in a dataset around the mean.
Standard Deviation: A measure of the amount of variation or dispersion of a set of values
from the mean.
Algorithm:
1. Import the required libraries.
2. Load the iris dataset.
3. Calculate the mean, median, mode, variance and standard deviation.
4. Display the results.
Code:
import pandas as pd
import numpy as np
from scipy import stats