Data Science Practical Exam Programs

 Data Science Practical Exam Programs





slip 1 & slip 11

Write a Python program to create a Pie plot to get the frequency of the three species of the Iris data (Use iris.csv)

In [32]:
Out[32]:
IdSepalLengthCmSepalWidthCmPetalLengthCmPetalWidthCmSpecies
015.13.51.40.2Iris-setosa
124.93.01.40.2Iris-setosa
234.73.21.30.2Iris-setosa
344.63.11.50.2Iris-setosa
455.03.61.40.2Iris-setosa
.....................
1451466.73.05.22.3Iris-virginica
1461476.32.55.01.9Iris-virginica
1471486.53.05.22.0Iris-virginica
1481496.23.45.42.3Iris-virginica
1491505.93.05.11.8Iris-virginica

150 rows × 6 columns

In [ ]:
In [28]:
In [31]:
Out[31]:
Iris-setosa        50
Iris-versicolor    50
Iris-virginica     50
Name: Species, dtype: int64
In [33]:
Out[33]:
0.2    28
1.3    13
1.8    12
1.5    12
1.4     8
2.3     8
1.0     7
0.4     7
0.3     7
0.1     6
2.1     6
2.0     6
1.2     5
1.9     5
1.6     4
2.5     3
2.2     3
2.4     3
1.1     3
1.7     2
0.6     1
0.5     1
Name: PetalWidthCm, dtype: int64
In [35]:
Out[35]:
fixed acidity;"volatile acidity";"citric acid";"residual sugar";"chlorides";"free sulfur dioxide";"total sulfur dioxide";"density";"pH";"sulphates";"alcohol";"quality"
07.4;0.7;0;1.9;0.076;11;34;0.9978;3.51;0.56;9.4;5
17.8;0.88;0;2.6;0.098;25;67;0.9968;3.2;0.68;9.8;5
27.8;0.76;0.04;2.3;0.092;15;54;0.997;3.26;0.65;...
311.2;0.28;0.56;1.9;0.075;17;60;0.998;3.16;0.58...
47.4;0.7;0;1.9;0.076;11;34;0.9978;3.51;0.56;9.4;5
......
15946.2;0.6;0.08;2;0.09;32;44;0.9949;3.45;0.58;10.5;5
15955.9;0.55;0.1;2.2;0.062;39;51;0.99512;3.52;0.76...
15966.3;0.51;0.13;2.3;0.076;29;40;0.99574;3.42;0.7...
15975.9;0.645;0.12;2;0.075;32;44;0.99547;3.57;0.71...
15986;0.31;0.47;3.6;0.067;18;42;0.99549;3.39;0.66;...

1599 rows × 1 columns

In [36]:
Out[36]:
fixed acidity;"volatile acidity";"citric acid";"residual sugar";"chlorides";"free sulfur dioxide";"total sulfur dioxide";"density";"pH";"sulphates";"alcohol";"quality"
count1599
unique1359
top7.2;0.36;0.46;2.1;0.074;24;44;0.99534;3.4;0.85...
freq4
In [37]:
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 1599 entries, 0 to 1598
Data columns (total 1 columns):
 #   Column                                                                                                                                                                   Non-Null Count  Dtype 
---  ------                                                                                                                                                                   --------------  ----- 
 0   fixed acidity;"volatile acidity";"citric acid";"residual sugar";"chlorides";"free sulfur dioxide";"total sulfur dioxide";"density";"pH";"sulphates";"alcohol";"quality"  1599 non-null   object
dtypes: object(1)
memory usage: 12.6+ KB
In [ ]:

slip 2 and slip 6

Q.2 A) Write a Python program for Handling Missing Value. Replace missing value of salary, age column with mean of that column.(Use Data.csv file).

In [57]:
Out[57]:
nameagesalary
0swapnil22.0300.0
1rajNaN233.0
2ajayNaNNaN
3vijay32.0234.0
4saurabh23.0NaN
5sonnyNaN234.0
In [59]:
Out[59]:
nameagesalary
0swapnil22.000000300.0
1raj25.666667233.0
2ajay25.666667NaN
3vijay32.000000234.0
4saurabh23.000000NaN
5sonny25.666667234.0
In [60]:
Out[60]:
nameagesalary
0swapnil22.000000300.00
1raj25.666667233.00
2ajay25.666667250.25
3vijay32.000000234.00
4saurabh23.000000250.25
5sonny25.666667234.00
In [ ]:

Q.2 B) Write a Python program to generate a line plot of name Vs salary [5]

In [66]:

Download the heights and weights dataset and load the dataset froma given csv file into a dataframe. Print the first, last 10 rows and random 20 rows also display shape of the dataset.

In [69]:
Out[69]:
heightweight
0756
1645
2545
3546
4475
5667
6636
7435
8875
9656
10547
11488
12890
13556
14345
15546
16475
17667
18636
19435
20875
21656
In [70]:
Out[70]:
heightweight
0756
1645
2545
3546
4475
5667
6636
7435
8875
9656
In [71]:
Out[71]:
heightweight
12890
13556
14345
15546
16475
17667
18636
19435
20875
21656
In [ ]:
In [74]:
Out[74]:
heightweight
12890
1645
14345
16475
3546
8875
17667
13556
21656
0756
2545
5667
11488
6636
7435
4475
20875
15546
10547
19435
In [76]:
Out[76]:
(22, 2)
In [ ]:

slip 3

Write a Python program to create box plots to see how each feature i.e. Sepal Length, Sepal Width, Petal Length, Petal Width are distributed across the three species. (Use iris.csv dataset)

In [88]:
Out[88]:
IdSepalLengthCmSepalWidthCmPetalLengthCmPetalWidthCmSpecies
015.13.51.40.2Iris-setosa
124.93.01.40.2Iris-setosa
234.73.21.30.2Iris-setosa
344.63.11.50.2Iris-setosa
455.03.61.40.2Iris-setosa
.....................
1451466.73.05.22.3Iris-virginica
1461476.32.55.01.9Iris-virginica
1471486.53.05.22.0Iris-virginica
1481496.23.45.42.3Iris-virginica
1491505.93.05.11.8Iris-virginica

150 rows × 6 columns

In [97]:
Out[97]:
{'whiskers': [<matplotlib.lines.Line2D at 0x1b41b07fd90>,
  <matplotlib.lines.Line2D at 0x1b41b090160>],
 'caps': [<matplotlib.lines.Line2D at 0x1b41b0904f0>,
  <matplotlib.lines.Line2D at 0x1b41b0908b0>],
 'boxes': [<matplotlib.lines.Line2D at 0x1b41b07fa60>],
 'medians': [<matplotlib.lines.Line2D at 0x1b41b090c40>],
 'fliers': [<matplotlib.lines.Line2D at 0x1b41b090fd0>],
 'means': []}
In [98]:
Out[98]:
{'whiskers': [<matplotlib.lines.Line2D at 0x1b41b0f8370>,
  <matplotlib.lines.Line2D at 0x1b41b0f8700>],
 'caps': [<matplotlib.lines.Line2D at 0x1b41b0f8a90>,
  <matplotlib.lines.Line2D at 0x1b41b0f8e20>],
 'boxes': [<matplotlib.lines.Line2D at 0x1b41b0e9f70>],
 'medians': [<matplotlib.lines.Line2D at 0x1b41b1011f0>],
 'fliers': [<matplotlib.lines.Line2D at 0x1b41b101580>],
 'means': []}
In [99]:
Out[99]:
{'whiskers': [<matplotlib.lines.Line2D at 0x1b41b15e9d0>,
  <matplotlib.lines.Line2D at 0x1b41b15ed00>],
 'caps': [<matplotlib.lines.Line2D at 0x1b41b16c0d0>,
  <matplotlib.lines.Line2D at 0x1b41b16c460>],
 'boxes': [<matplotlib.lines.Line2D at 0x1b41b15e640>],
 'medians': [<matplotlib.lines.Line2D at 0x1b41b16c7f0>],
 'fliers': [<matplotlib.lines.Line2D at 0x1b41b16cbb0>],
 'means': []}
In [100]:
Out[100]:
{'whiskers': [<matplotlib.lines.Line2D at 0x1b41b32a490>,
  <matplotlib.lines.Line2D at 0x1b41b32a820>],
 'caps': [<matplotlib.lines.Line2D at 0x1b41b32abb0>,
  <matplotlib.lines.Line2D at 0x1b41b32aee0>],
 'boxes': [<matplotlib.lines.Line2D at 0x1b41b32a100>],
 'medians': [<matplotlib.lines.Line2D at 0x1b41b3372b0>],
 'fliers': [<matplotlib.lines.Line2D at 0x1b41b337640>],
 'means': []}

Write a Python program to view basic statistical details of the data (Use Heights and Weights Dataset

In [101]:
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 22 entries, 0 to 21
Data columns (total 2 columns):
 #   Column  Non-Null Count  Dtype
---  ------  --------------  -----
 0   height  22 non-null     int64
 1   weight  22 non-null     int64
dtypes: int64(2)
memory usage: 480.0 bytes
In [102]:
Out[102]:
heightweight
count22.0000022.000000
mean5.5000056.909091
std1.4057717.146176
min3.0000035.000000
25%4.2500045.000000
50%5.5000056.000000
75%6.0000073.000000
max8.0000090.000000
In [ ]:
In [112]:
Out[112]:
89
In [113]:
Out[113]:
array([84, 49, 52, 66, 81, 34, 30,  2, 15, 14, 23, 85,  9, 22, 58, 69, 67,
       48,  3, 92, 54, 43, 79, 82, 70,  9, 19, 90, 57, 19, 18, 59, 97, 25,
       99, 74, 62, 38, 10,  9, 49,  7, 34, 53, 89, 74, 54,  1, 49, 67])
In [120]:
Out[120]:
Text(0.5, 1.0, 'line chart')
In [122]:
In [127]:
In [130]:
In [ ]:

Write a Python program to print the shape, number of rows-columns, data types, feature names and the description of the data(Use User_Data.csv)

In [133]:
Out[133]:
idnamecityphone
011swapnilpune12344
122rajmumbai1234
233vijaypatas2344
344jaybaramti87
455ajayroti8427
In [134]:
Out[134]:
(5, 4)
In [135]:
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 5 entries, 0 to 4
Data columns (total 4 columns):
 #   Column  Non-Null Count  Dtype 
---  ------  --------------  ----- 
 0   id      5 non-null      int64 
 1    name   5 non-null      object
 2    city   5 non-null      object
 3    phone  5 non-null      int64 
dtypes: int64(2), object(2)
memory usage: 288.0+ bytes
In [137]:
Out[137]:
id         int64
 name     object
 city     object
 phone     int64
dtype: object
In [145]:
Out[145]:
idphone
count5.0000005.000000
mean33.0000004887.200000
std17.3925275267.582624
min11.00000087.000000
25%22.0000001234.000000
50%33.0000002344.000000
75%44.0000008427.000000
max55.00000012344.000000



slip 7

Write a Python program to perform the following tasks : a. Apply OneHot coding on Country column. b. Apply Label encoding on purchased column (Data.csv have two categorical column the country column, and the purchased column).

In [147]:
Out[147]:
CountryAgeSalaryPurchased
0France4472000No
1Spain2748000Yes
2Germany3054000No
3Spain3861000No
4Germany40YesNaN
5France3558000Yes
6Spain52000NoNaN
7France4879000Yes
8Germany5083000No
9France3767000Yes
In [156]:
Out[156]:
01234
00.01.00.01.00.0
11.00.01.00.01.0
21.00.01.00.01.0
31.00.01.00.01.0
41.00.01.00.01.0
50.01.00.01.00.0
61.00.01.00.01.0
70.01.00.01.00.0
81.00.01.00.01.0
90.01.00.01.00.0
In [157]:
Out[157]:
01234
00.01.00.01.00
11.00.01.00.01
21.00.01.00.01
31.00.01.00.01
41.00.01.00.01
50.01.00.01.00
61.00.01.00.01
70.01.00.01.00
81.00.01.00.01
90.01.00.01.00

Write a program in python to perform following task : [15] Standardizing Data (transform them into a standard Gaussian distribution with a mean of 0 and a standard deviation of 1) (Use winequality-red.csv)

In [159]:
Out[159]:
01234
0-1.1618951.161895-1.1618951.161895-1.161895
10.774597-0.7745970.774597-0.7745970.774597
20.774597-0.7745970.774597-0.7745970.774597
30.774597-0.7745970.774597-0.7745970.774597
40.774597-0.7745970.774597-0.7745970.774597
5-1.1618951.161895-1.1618951.161895-1.161895
60.774597-0.7745970.774597-0.7745970.774597
7-1.1618951.161895-1.1618951.161895-1.161895
80.774597-0.7745970.774597-0.7745970.774597
9-1.1618951.161895-1.1618951.161895-1.161895
In [160]:
Out[160]:
0    4.440892e-17
1   -4.440892e-17
2    4.440892e-17
3   -4.440892e-17
4    2.220446e-17
dtype: float64
In [162]:
Out[162]:
0    1.0
1    1.0
2    1.0
3    1.0
4    1.0
dtype: float64
In [ ]:

Create two lists, one representing subject names and the other representing marks obtained in those subjects. Display the data in a pie chart.

In [167]:
Out[167]:
([<matplotlib.patches.Wedge at 0x1b41e568eb0>,
  <matplotlib.patches.Wedge at 0x1b41e574460>,
  <matplotlib.patches.Wedge at 0x1b41e574940>,
  <matplotlib.patches.Wedge at 0x1b41e574e20>,
  <matplotlib.patches.Wedge at 0x1b41e57f340>,
  <matplotlib.patches.Wedge at 0x1b41e57f820>],
 [Text(0.9163353394095168, 0.608547077677024, 'math'),
  Text(-0.024799968250606833, 1.099720401545215, 'marathi'),
  Text(-0.7748890343653689, 0.7807349002192141, 'english'),
  Text(-1.0984780301579335, -0.057844768651503314, 'stat'),
  Text(-0.30990577210017567, -1.055442282845914, 'python'),
  Text(0.9298224053418628, -0.5877331831063078, 'java')])

Write a program in python to perform following task (Use winequality-red.csv ) [5] Import Dataset and do the followings: a) Describing the dataset b) Shape of the dataset c) Display first 3 rows from datasee

In [171]:
Out[171]:
CountryAgeSalaryPurchased
0France4472000No
1Spain2748000Yes
2Germany3054000No
3Spain3861000No
4Germany40YesNaN
5France3558000Yes
6Spain52000NoNaN
7France4879000Yes
8Germany5083000No
9France3767000Yes
In [173]:
Out[173]:
Age
count10.000000
mean5234.900000
std16431.582824
min27.000000
25%35.500000
50%39.000000
75%47.000000
max52000.000000
In [176]:
Out[176]:
(10, 4)
In [177]:
Out[177]:
CountryAgeSalaryPurchased
0France4472000No
1Spain2748000Yes
2Germany3054000No
In [ ]:

slip 10

Write a python program to Display column-wise mean, and median for SOCRHeightWeight dataset.

In [179]:
Out[179]:
heightweight
0756
1645
2545
3546
4475
5667
6636
7435
8875
9656
10547
11488
12890
13556
14345
15546
16475
17667
18636
19435
20875
21656
In [236]:
Out[236]:
height     5.500000
weight    56.909091
dtype: float64
In [237]:
Out[237]:
height     5.5
weight    56.0
dtype: float64
In [239]:
Out[239]:
5.5

Write a python program to compute sum of Manhattan distance between all pairs of points.

In [183]:
63
In [240]:
1131

slip 12

Write a Python program to create data frame containing column name, salary, department add 10 rows with some missing and duplicate values to the data frame. Also drop all null and empty values. Print the modified data frame

In [229]:
Out[229]:
namesalarydapartment
0swapnil50399airforce
1nihan50399airforce
2vijay24499math
3jaycsNaN
4ajayNoneairforce
5vinu50399None
6bharat50399airforce
7suahasairforceNone
8nihan50399airforce
9kemal50399airforce
In [241]:
Out[241]:
namesalarydapartment
0FalseFalseFalse
1FalseFalseFalse
2FalseFalseFalse
3FalseFalseFalse
4FalseTrueFalse
5FalseFalseTrue
6FalseFalseFalse
7FalseFalseTrue
8FalseFalseFalse
9FalseFalseFalse
In [242]:
Out[242]:
0    False
1    False
2    False
3    False
4    False
5    False
6    False
7    False
8     True
9    False
dtype: bool
In [243]:
Out[243]:
<bound method DataFrame.drop of       name    salary dapartment
0  swapnil     50399   airforce
1    nihan     50399   airforce
2    vijay     24499       math
3      jay        cs        NaN
4     ajay      None   airforce
5     vinu     50399       None
6   bharat     50399   airforce
7   suahas  airforce       None
8    nihan     50399   airforce
9    kemal     50399   airforce>
In [244]:
Out[244]:
namesalarydapartment
0swapnil50399airforce
1nihan50399airforce
2vijay24499math
3jaycsNaN
4ajayNoneairforce
5vinu50399None
6bharat50399airforce
7suahasairforceNone
8nihan50399airforce
9kemal50399airforce
In [245]:
Out[245]:
namesalarydapartment
0swapnil50399airforce
1nihan50399airforce
2vijay24499math
3jaycsNaN
6bharat50399airforce
8nihan50399airforce
9kemal50399airforce
In [246]:
Out[246]:
namesalarydapartment
0swapnil50399airforce
1nihan50399airforce
2vijay24499math
3jaycsNaN
4ajayNoneairforce
5vinu50399None
6bharat50399airforce
7suahasairforceNone
8nihan50399airforce
9kemal50399airforce

slip 13

) Write a Python program to create a graph to find relationship between the petal length and petal width.(Use iris.csv dataset)

In [250]:
Out[250]:
IdSepalLengthCmSepalWidthCmPetalLengthCmPetalWidthCmSpecies
015.13.51.40.2Iris-setosa
124.93.01.40.2Iris-setosa
234.73.21.30.2Iris-setosa
344.63.11.50.2Iris-setosa
455.03.61.40.2Iris-setosa
.....................
1451466.73.05.22.3Iris-virginica
1461476.32.55.01.9Iris-virginica
1471486.53.05.22.0Iris-virginica
1481496.23.45.42.3Iris-virginica
1491505.93.05.11.8Iris-virginica

150 rows × 6 columns

In [252]:
Out[252]:
<AxesSubplot:xlabel='PetalLengthCm', ylabel='PetalWidthCm'>
In [253]:

Write a Python program to find the maximum and minimum value of a given flattened array.

In [258]:
Out[258]:
9
In [260]:
Out[260]:
1
In [ ]:



slip 16

Write a python program to create a data frame for students’ information such as name, graduation percentage and age. Display average age of students, average of graduation percentage.

In [1]:
Out[1]:
namepercentageage
0swapnil8822
1om8812
2jay9832
3sai4525
4didi8322
5swapnil8822
In [8]:
Out[8]:
22.5
In [10]:
Out[10]:
81.66666666666667
In [32]:
In [31]:

slip 17

Write a Python program to draw scatter plots to compare two features of the iris dataset

In [36]:
Out[36]:
IdSepalLengthCmSepalWidthCmPetalLengthCmPetalWidthCmSpecies
015.13.51.40.2Iris-setosa
124.93.01.40.2Iris-setosa
234.73.21.30.2Iris-setosa
344.63.11.50.2Iris-setosa
455.03.61.40.2Iris-setosa
.....................
1451466.73.05.22.3Iris-virginica
1461476.32.55.01.9Iris-virginica
1471486.53.05.22.0Iris-virginica
1481496.23.45.42.3Iris-virginica
1491505.93.05.11.8Iris-virginica

150 rows × 6 columns

In [54]:
In [55]:
Out[55]:
namepercentageage
0swapnil8822
1om8812
2jay9832
3sai4525
4didi8322
5swapnil8822
In [ ]:

slip 18

Write a Python program to create box plots to see how each feature i.e. Sepal Length, Sepal Width, Petal Length, Petal Width are distributed across the three species. (Use iris.csv dataset)

In [59]:
In [61]:
In [62]:
In [63]:

Use the heights and weights dataset and load the dataset from a given csv file into a dataframe. Print the first, last 5 rows and random 10 row

In [65]:
Out[65]:
heightweight
0756
1645
2545
3546
4475
In [66]:
Out[66]:
heightweight
17667
18636
19435
20875
21656
In [67]:
Out[67]:
heightweight
12890
11488
5667
13556
20875
17667
16475
0756
21656
3546

slip 19

) Write a Python program [15]

  1. To create a dataframe containing columns name, age and percentage. Add 10 rows to the dataframe. View the dataframe.
  2. To print the shape, number of rows-columns, data types, feature names and the description of the data
  3. To Add 5 rows with duplicate values and missing values. Add a column ‘remarks’ with empty values. Display the data.
In [69]:
Out[69]:
namepercentageage
0swapnil8822
1om8812
2jay9832
3sai4525
4didi8322
5swapnil8822
In [71]:
Out[71]:
(6, 3)
In [73]:
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 6 entries, 0 to 5
Data columns (total 3 columns):
 #   Column      Non-Null Count  Dtype 
---  ------      --------------  ----- 
 0   name        6 non-null      object
 1   percentage  6 non-null      int64 
 2   age         6 non-null      int64 
dtypes: int64(2), object(1)
memory usage: 272.0+ bytes
In [74]:
Out[74]:
name          object
percentage     int64
age            int64
dtype: object
In [76]:
Out[76]:
percentageage
count6.0000006.000000
mean81.66666722.500000
std18.6189876.442049
min45.00000012.000000
25%84.25000022.000000
50%88.00000022.000000
75%88.00000024.250000
max98.00000032.000000
In [77]:
Out[77]:
namepercentageage
0swapnil8822
1om8812
2jay9832
3sai4525
4didi8322
5swapnil8822
6om8812
In [79]:
Out[79]:
namepercentageage
0swapnil88.022.0
1om88.012.0
2jay98.032.0
3sai45.025.0
4didi83.022.0
5swapnil88.022.0
6om88.012.0
7NoneNaN49.0
8rohitNaN49.0
9didi83.022.0
10NoneNaNNaN
In [81]:
Out[81]:
namepercentageageremark
0swapnil88.022.0None
1om88.012.0None
2jay98.032.0None
3sai45.025.0None
4didi83.022.0None
5swapnil88.022.0None
6om88.012.0None
7NoneNaN49.0None
8rohitNaN49.0None
9didi83.022.0None
10NoneNaNNaNNone

slip20

Add two outliers to the above data and display the box plot.

In [91]:
In [ ]:

slip 21

Import dataset “iris.csv”. Write a Python program to create a Bar plot to get the frequency of the three species of the Iris data.

In [93]:
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_8604/1709669635.py in <module>
      5 iris = pd.read_csv("Iris.csv")
      6 
----> 7 iris['Species'].value_counts().plt.bar()
      8 
      9 plt.title("Iris Species %")

~\anaconda3\lib\site-packages\pandas\core\generic.py in __getattr__(self, name)
   5485         ):
   5486             return self[name]
-> 5487         return object.__getattribute__(self, name)
   5488 
   5489     def __setattr__(self, name: str, value) -> None:

AttributeError: 'Series' object has no attribute 'plt'

Write a Python program to create a histogram of the three species of the Iris data.
slip 24 Q2

In [106]:
In [96]:
Out[96]:
IdSepalLengthCmSepalWidthCmPetalLengthCmPetalWidthCmSpecies
015.13.51.40.2Iris-setosa
124.93.01.40.2Iris-setosa
234.73.21.30.2Iris-setosa
344.63.11.50.2Iris-setosa
455.03.61.40.2Iris-setosa
.....................
1451466.73.05.22.3Iris-virginica
1461476.32.55.01.9Iris-virginica
1471486.53.05.22.0Iris-virginica
1481496.23.45.42.3Iris-virginica
1491505.93.05.11.8Iris-virginica

150 rows × 6 columns

In [112]:
Out[112]:
<BarContainer object of 150 artists>








slip 30 ,26,25,20,15,12,9,,4

generate a random array of 50 intger and display them using a line chart , scatter plot , histogram and box plot Apply the appropriate color , labels and styling options

In [5]:
[67 79 16 57 14 84 58 17 73 22 12 34 59 54 91 42 87 74  9  6]
In [25]:
In [12]:
Out[12]:
array([ 2, 30, 30,  4, 72, 57, 35, 32, 55, 86, 54, 21, 83, 72, 51, 21, 49,
       99,  8, 87, 68, 16, 40, 74, 57, 10, 68, 78, 49, 43,  3, 73, 18, 44,
        6, 51, 81, 86, 16, 41, 86, 54, 99, 10, 65, 43, 18, 93, 74, 30])
In [26]:
In [27]:
In [ ]:

create two list one representing subject name and other representing marks obtained on those subject display data in the bar chart

In [31]:





Slip  28



In [11]:
Out[11]:
NameHeightWeight
0Nil758
1NaN6.049.0
2Emma645
3Swapnil556
4SwamirajNone56
5Vaishu449
6Snehal558
7Vaishu449
8Navin5None
9Shreya656
In [12]:
Out[12]:
(10, 3)
In [13]:
Out[13]:
30
In [14]:
Out[14]:
Name      object
Height    object
Weight    object
dtype: object
In [15]:
Out[15]:
NameHeightWeight
count99.09.0
unique84.04.0
topVaishu6.049.0
freq23.03.0
In [16]:
<class 'pandas.core.frame.DataFrame'>
Int64Index: 10 entries, 0 to 9
Data columns (total 3 columns):
 #   Column  Non-Null Count  Dtype 
---  ------  --------------  ----- 
 0   Name    9 non-null      object
 1   Height  9 non-null      object
 2   Weight  9 non-null      object
dtypes: object(3)
memory usage: 320.0+ bytes
In [17]:
Out[17]:
NameHeightWeight
0FalseFalseFalse
1TrueFalseFalse
2FalseFalseFalse
3FalseFalseFalse
4FalseTrueFalse
5FalseFalseFalse
6FalseFalseFalse
7FalseFalseFalse
8FalseFalseTrue
9FalseFalseFalse
In [18]:
Out[18]:
NameHeightWeight
0Nil758
2Emma645
3Swapnil556
5Vaishu449
6Snehal558
7Vaishu449
9Shreya656
In [20]:
In [21]:
Out[21]:
NameHeightWeightBMI
0Nil7581.183673
1NaN6.049.01.361111
2Emma6451.25
3Swapnil5562.24
4SwamirajNone56NaN
5Vaishu4493.0625
6Snehal5582.32
7Vaishu4493.0625
8Navin5NoneNaN
9Shreya6561.555556
In [25]:
Out[25]:
3.0625
In [26]:
Out[26]:
1.183673469387755
In [27]:
Out[27]:
<AxesSubplot:xlabel='Height', ylabel='Weight'>






























s
















































s






















































s


Comments

Post a Comment

hey

Popular posts from this blog

Practical slips programs : Machine Learning

Full Stack Developement Practical Slips Programs

Android App Developement Practicals Programs