3/7/24, 11:56 AM Lab4Task.
ipynb - Colaboratory
File
Connect
to a
Hassan Saeed 205277
runtime
to
enable
Double-click (or enter) to edit file
browsin
import numpy as np
import pandas as pd
Double-click (or enter) to edit
df=pd.read_csv("Task1_dataset.csv")
df.head()
output Age Income Satisfaction Group
0 58 63113.201702 2 Group C
1 33 45217.390918 7 Group C
2 26 50801.362210 2 Group C
3 40 15847.137260 3 Group B
4 36 52928.813206 2 Group A
Next steps: toggle_off View recommended plots
df.shape
(100, 4)
df.describe()
Age Income Satisfaction
count 100.000000 100.000000 100.000000
mean 39.620000 50487.208788 5.040000
std 12.024201 13843.497238 2.722595
min 19.000000 11321.645324 1.000000
25% 28.750000 43451.715088 3.000000
50% 39.000000 51450.882270 5.000000
75% 50.000000 61209.997222 7.000000
max 59.000000 72595.953172 10.000000
mean_age=df["Age"].mean()
print("age mean is :")
mean_age
39.62
median_age=df["Age"].median()
print("age median is :")
median_age
39.0
https://colab.research.google.com/drive/1IIcUqGv9TfiqQF3LTqpZm9N_OVKGTLsJ#scrollTo=UlPFAoFoov_6&printMode=true 1/3
3/7/24, 11:56 AM Lab4Task.ipynb - Colaboratory
mode_age=df["Age"].mode()[0]
print("age mode is :")
mode_age
44
mean_income=df["Income"].mean()
print("income mean is :")
mean_income
50487.20878801228
median_income=df["Income"].median()
print("Income median is :")
median_income
51450.882269579786
mode_income=df["Income"].mode()[0]
print("income mode is :")
mode_income
income mode is :
11321.64532403621
mean_satisfaction=df["Satisfaction"].mean()
print("satisfaction mean is :")
mean_satisfaction
satisfaction mean is :
5.04
mode_satisfaction=df["Satisfaction"].mode()[0]
print("satisfaction mode is :")
mode_satisfaction
median_satisfaction=df["Satisfaction"].median()
print("satisfaction median is :")
median_satisfaction
satisfaction median is :
5.0
keyboard_arrow_down Data Analysis
The analysis of the dataset on daily internet usage by individuals has been completed, yielding the following measures of central tendency:
Mean Age is: 39.62
Mode Age is: 44
Median of Age is:39.0
Mean Income is:50487.20878801228
Mode of Income is:11321.64532403621
Median of Inccome is:51450.882269579786
Mean Satisfaction is:5.04
Mode of Satisfaction is:4
Median of Satisfaction is:5.0
https://colab.research.google.com/drive/1IIcUqGv9TfiqQF3LTqpZm9N_OVKGTLsJ#scrollTo=UlPFAoFoov_6&printMode=true 2/3
3/7/24, 11:56 AM Lab4Task.ipynb - Colaboratory
These results indicate that on average, age is 39.62 of peole having icome 50487.2 and have satisfction levle 5.04. The median value
suggests that half of the individuals have age more then 39 and have income 51450 and have satisfction level 5.04.55 while the other half
have less. The mode indicates that the most common occuirng age is 4 and have income 11321 with satisfaction 4.0 .
keyboard_arrow_down Report
Mean of Age is: 39.62 years Median of Age is: 39.0 Mode of Age is: 39.0
Mean of Income is: 50487.20878801228 Median of Income is: 51450.882269579786 Mode of Income is: 11321.64532403621
Mean of Satisfaction is: 5.04 Median of Satisfaction is: 5.0 Mode of Satisfaction is: 4
These results shows that the avearge age of person of organization is 39.62 years taking average income of 50487.20878801228 having the
average satisfaction level of 5.04.
The median value suggests that half of the individuals having age 39.0 is taking the income which is above 51450.882269579786 and they
have the satisfaction level of 5.0,while the other half is taking less incomeand have less satisfactory level.
The mode indicates that the most common age is 39.0 among the individuals in the dataset and the most common income of the individual
is 11321.64532403621 and the common satisfaction level is 4.
https://colab.research.google.com/drive/1IIcUqGv9TfiqQF3LTqpZm9N_OVKGTLsJ#scrollTo=UlPFAoFoov_6&printMode=true 3/3