0% found this document useful (0 votes)
10 views5 pages

457 Labs2

qm457 labs2

Uploaded by

fatialqaffas31
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views5 pages

457 Labs2

qm457 labs2

Uploaded by

fatialqaffas31
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

import pandas as pd

import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
import sklearn
import csv

St = pd.read_csv("Student22.csv")

#List the columns of the dataset


St.columns

Index(['Id', 'Math', 'Arabic', 'English', 'Sport', 'history ',


'physics',
'Class'],
dtype='object')

#Show the dataset size


St.size

6320

#Show the dataset shape


print("shpe of dataframe:", St.shape)

shpe of dataframe: (790, 8)

#Show and explain the information about the dataset


St.info()

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 790 entries, 0 to 789
Data columns (total 8 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Id 790 non-null int64
1 Math 790 non-null int64
2 Arabic 790 non-null int64
3 English 790 non-null int64
4 Sport 790 non-null int64
5 history 790 non-null int64
6 physics 790 non-null int64
7 Class 790 non-null object
dtypes: int64(7), object(1)
memory usage: 49.5+ KB

#Is there is a missing value?


St.isnull().sum()

Id 0
Math 0
Arabic 0
English 0
Sport 0
history 0
physics 0
Class 0
dtype: int64

#Check the outliers


sns.boxplot(data=St)
plt.show()

#Plot the Math variable and output(s) distributions and give your
comment
#math:
plt.figure(figsize=(15,5))
sns.countplot(x="Math", data=St)

<Axes: xlabel='Math', ylabel='count'>


#MODIFY FIGURE
plt.figure(figsize=(15,5))
sns.countplot(y="Math", data=St)
plt.show()

#Show the count plot for the math course.


St.Math.value_counts()

Math
80 66
75 52
95 44
98 44
69 44
76 36
77 36
71 32
67 32
66 32
87 24
73 24
65 24
74 24
60 24
78 20
89 20
79 16
72 16
85 16
81 16
82 14
96 14
54 14
88 12
84 12
55 12
62 8
86 8
58 8
70 8
94 8
92 8
93 8
68 8
90 6
Name: count, dtype: int64

#Plot the Arabic variable and output(s) distributions and give your
comment
plt.figure(figsize = (15,5))
sns.countplot(x="Arabic", data=St)

<Axes: xlabel='Arabic', ylabel='count'>

#Show the count plot for the Arabic course.


St.Arabic.value_counts()
Arabic
80 88
85 48
90 44
89 44
60 40
70 36
77 28
78 28
88 28
66 26
76 24
86 24
100 24
72 24
97 20
55 20
69 18
68 18
84 16
71 16
75 16
95 16
99 16
63 16
94 12
64 12
79 12
57 8
87 8
51 8
93 8
82 8
53 8
91 8
59 8
67 6
65 6
Name: count, dtype: int64

You might also like