Which group of people remeber things learned in schools?

By: Aayush Srivastava

Disclaimer:

The data for the analysis was collected through a survey without invigilation, which could have allowed some degree of bias and unreliability in the data. The author(s) won't be responsible for any incorrect data and fallacies.

Brief:

The data was collected in the form of a simple MCQ test based on things generally taught in schools. The user was asked for some basic details like gender, age, nature and past academic record. The data was then sorted into smalled frames on the basis of the characteristics, for example age groups. Then the average score of each group was calculated and the group with highest average was deemed the winner in the respective category.

Analysis:

In [1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

Importing the dataset:

In [2]:
mdata=pd.read_csv('/home/aayush/Projects/Python/Do people remeber what they learned in school/data.csv')
mdata.head()
Out[2]:
Timestamp Score Which age group you belong to? Which one of the following best describes you? Which one of the following best describes you?.1 How good were you in school? On a scale of 1-10 how do you feel about school days? The side opposite to the right angle in a right angled triangle is? What is Density of water? In a neutral atom the number of protons is numerically equal to? Which is the smallest country by area in the world? What are the egg laying mammals left on Earth? What is the deepest point on Earth? Rabi crops are sown in the month of? Which planet spins opposite to Earth? In which sex is more likely to suffer from color blindness? Optical fiber works on the principle of? (e^(i*pi)) =
0 9/19/2020 16:05:45 11 / 11 20-30 Male Introvert Above Average 5 Hypotenuse 997 kg/m³ Number of Electrons Vatican City Echidna, Platypus Challenger Deep November Venus Male Total Internal Reflection -1.0
1 9/19/2020 16:38:15 3 / 11 20-30 Female Ambivert Average 9 Adjacent 997 kg/m³ None/ Can't be determined. Vatican City Platypus Puerto Rico Trench April Venus Female Oscillation inf
2 9/19/2020 16:45:57 10 / 11 20-30 Female Extrovert Average 4 Hypotenuse 997 kg/m³ Number of Electrons Vatican City Platypus Challenger Deep November Venus Male Total Internal Reflection -1.0
3 9/19/2020 16:47:46 3 / 11 20-30 Female Ambivert Above Average 8 Hypotenuse 1000 kg/m³ Number of Neutrons + Number of Electrons Vatican City Obdurodon Peru–Chile Trench April Mercury Male Radiation inf
4 9/19/2020 16:52:52 9 / 11 20-30 Male Introvert Above Average 7 Hypotenuse 997 kg/m³ Number of Electrons Vatican City Platypus Challenger Deep November Venus Male Total Internal Reflection 0.0

Helper Functions:

In [3]:
def calc_avg(scores):
    '''Calculate the average score.'''
    sum=0
    for i in scores:
        sum+=int(i.split()[0])
    return sum/len(scores)
In [4]:
def split_data(fra,col,val):
    '''Splits main data frame into samller frames.'''
    return fra.loc[fra[col]==val]
In [5]:
def better(pos,*f):
    '''Finds the better scoring group.'''
    cnt=0
    best=[0,0]
    for i in f:
        print('Average score of '+str(pos[cnt])+' is:'+str(calc_avg(i['Score'])))
        if calc_avg(i['Score'])>best[0]:
            best[0]=calc_avg(i['Score'])
            best[1]=cnt
        cnt+=1
    return pos[best[1]]

Splitting the data according to age :

The data is split into two groups namely age group '20-30' represented by data_20_30 and the group Below 20 represented by data_20 .

In [6]:
data_20_30,data_20=split_data(mdata,'Which age group you belong to?','20-30'),split_data(mdata,'Which age group you belong to?','Below 20')
In [7]:
p=['Below 20','20-30']
better(p,data_20,data_20_30)
Average score of Below 20 is:6.40625
Average score of 20-30 is:6.7317073170731705
Out[7]:
'20-30'

From the above results we can say that people in age group 20-30 performed better than people younger than 20.

Splitting the data according to gender :

The data is split into two groups 'male' represented by data_male and the 'female' represented by data_female .

In [8]:
data_male,data_female=split_data(mdata,'Which one of the following best describes you?','Male'),split_data(mdata,'Which one of the following best describes you?','Female')
In [9]:
p=['Male','Female']
better(p,data_male,data_female)
Average score of Male is:6.314285714285714
Average score of Female is:6.82051282051282
Out[9]:
'Female'

From the above results we can say that females performed better than males.

Splitting the data according to behaviour :

We split the data into three groups Introverts, Extroverts and Ambivert .

In [10]:
data_intro,data_extro,data_ambi=split_data(mdata,'Which one of the following best describes you?.1','Introvert'),split_data(mdata,'Which one of the following best describes you?.1','Extrovert'),split_data(mdata,'Which one of the following best describes you?.1','Ambivert')
In [11]:
p=['Introvert','Extrovert','Ambivert']
better(p,data_intro,data_extro,data_ambi)
Average score of Introvert is:6.5625
Average score of Extrovert is:6.75
Average score of Ambivert is:6.5
Out[11]:
'Extrovert'

From the results we infer that Extroverts scored more than others.

Splitting the data according to academic record :

Four groups are made of people with an Below average, Average, Above Average and Extraordinary academic record.

In [12]:
data_below_avg,data_avg,data_above_avg,data_extra=split_data(mdata,'How good were you in school?','Below Average'),split_data(mdata,'How good were you in school?','Average'),split_data(mdata,'How good were you in school?','Above Average'),split_data(mdata,'How good were you in school?','Extraordinary')
In [13]:
p=['Below Average','Average','Above Average','Extraordinary']
better(p,data_below_avg,data_avg,data_above_avg,data_extra)
Average score of Below Average is:4.0
Average score of Average is:5.9
Average score of Above Average is:6.975
Average score of Extraordinary is:6.785714285714286
Out[13]:
'Above Average'

Hence we infer that people with an Above average academic record were better performers than others.

Splitting the data according to gender and behaviour :

Adding a little complexity to our analysis soo far we will split data into 6 groups 3 for men of different behaviours and 3 for women.

In [14]:
data_men_intro,data_men_extro,data_men_ambi=split_data(data_male,'Which one of the following best describes you?.1','Introvert'),split_data(data_male,'Which one of the following best describes you?.1','Extrovert'),split_data(data_male,'Which one of the following best describes you?.1','Ambivert')
In [15]:
data_wom_intro,data_wom_extro,data_wom_ambi=split_data(data_female,'Which one of the following best describes you?.1','Introvert'),split_data(data_female,'Which one of the following best describes you?.1','Extrovert'),split_data(data_female,'Which one of the following best describes you?.1','Ambivert')
In [16]:
p=['Male-Introvert','Male-Extrovert','Male-Ambivert','Female-Introvert','Female-Extrovert','Female-Ambivert']
better(p,data_men_intro,data_men_extro,data_men_ambi,data_wom_intro,data_wom_extro,data_wom_ambi)
Average score of Male-Introvert is:6.2105263157894735
Average score of Male-Extrovert is:6.428571428571429
Average score of Male-Ambivert is:6.444444444444445
Average score of Female-Introvert is:7.076923076923077
Average score of Female-Extrovert is:7.0
Average score of Female-Ambivert is:6.529411764705882
Out[16]:
'Female-Introvert'

Hence we infer that Introvert females perform better than other groups.

Conclusion:

From the above analysis we can infer that:

  1. People in the age group 20-30 better remember things taught in schools than younger candidates.
  2. Females are better than males at remembering school stuff.
  3. Extroverts are better than their others.
  4. People with an above average academic record have performed better than others quiet suprising.
  5. Females who are introverts are best at remebering school stuff than the other groups.