Professional Documents
Culture Documents
AP19110010030 Assignment-2 Lab
AP19110010030 Assignment-2 Lab
Kilaru Sravan
AP19110010030
CSE-A
import pandas as pd
mobiles = {'Brand': ['Apple','MI','Samsung','Realme','Vivo','Oppo','One plus','Nokia','Micr
'Price in IND': [100000,20000,50000,35000,19000,17000,65000,15000,10000],
'Price in US': [90000,10000,40000,32000,18000,11000,45000,12000,15000]
}
df = pd.DataFrame(mobiles, columns = ['Brand', 'Price in IND','Price in US'])
print (df)
Brand Price in IND Price in US
1 MI 20000 10000
Mean of Dataset
In [22]:
df.mean()
Out[22]:
Price in US 30333.333333
dtype: float64
Median of Dataset
localhost:8888/notebooks/AP19110010030_Assignment-2.ipynb 1/7
23/08/2021 AP19110010030_Assignment-2 - Jupyter Notebook
In [23]:
df.median()
Out[23]:
Price in US 18000.0
dtype: float64
Mode of Dataset
In [24]:
df.mode()
#As there is no mode in dataset columns are printed in ascending order
Out[24]:
1 MI 15000 11000
Variance of Dataset
In [25]:
df.var()
Out[25]:
Price in US 6.727500e+08
dtype: float64
localhost:8888/notebooks/AP19110010030_Assignment-2.ipynb 2/7
23/08/2021 AP19110010030_Assignment-2 - Jupyter Notebook
In [26]:
df.std()
Out[26]:
Price in US 25937.424699
dtype: float64
Covarience of Dataset
In [27]:
df.cov()
Out[27]:
Correlation of Dataset
In [28]:
df.corr()
Out[28]:
localhost:8888/notebooks/AP19110010030_Assignment-2.ipynb 3/7
23/08/2021 AP19110010030_Assignment-2 - Jupyter Notebook
In [31]:
Maida flour,
Balu West
0 yogurt, oil, vegetarian 45 25 sweet dessert
shahi Bengal
sugar
Gram flour,
1 Boondi vegetarian 80 30 sweet dessert Rajasthan
ghee, sugar
Carrots,
Gajar milk, sugar,
2 ka ghee, vegetarian 15 60 sweet dessert Punjab
halwa cashews,
raisins
Flour, ghee,
kewra, milk,
3 Ghevar vegetarian 15 30 sweet dessert Rajasthan
clarified
butter, su...
Milk
powder,
Gulab plain flour, West
4 vegetarian 15 40 sweet dessert
jamun baking Bengal
powder,
ghee,...
Glutinous
rice, black
250 Til Pitha vegetarian 5 30 sweet dessert Assam
sesame
seeds, gur
Coconut
milk, egg
251 Bebinca yolks, vegetarian 20 60 sweet dessert Goa
clarified
butter, all...
Cottage
cheese, dry
Jammu &
252 Shufta dates, dried vegetarian -1 -1 sweet dessert
Kashmir
rose petals,
...
Milk
powder, dry
Mawa fruits, Madhya
253 vegetarian 20 45 sweet dessert C
Bati arrowroot Pradesh
powder,
all...
Brown rice,
fennel
seeds,
254 Pinaca vegetarian -1 -1 sweet dessert Goa
grated
coconut,
blac...
localhost:8888/notebooks/AP19110010030_Assignment-2.ipynb 4/7
23/08/2021 AP19110010030_Assignment-2 - Jupyter Notebook
df1.mean()
Out[34]:
prep_time 31.105882
cook_time 34.529412
dtype: float64
df1.median()
Out[35]:
prep_time 10.0
cook_time 30.0
dtype: float64
localhost:8888/notebooks/AP19110010030_Assignment-2.ipynb 5/7
23/08/2021 AP19110010030_Assignment-2 - Jupyter Notebook
In [36]:
df1.mode()
Out[36]:
Arbi ke
patte,
sesame main
0 Adhirasam vegetarian 10.0 30.0 spicy Gujarat
seeds, gur, course
bengal
gram ...
Chhena,
1 Aloo gobi NaN NaN NaN NaN NaN NaN
sugar, ghee
Aloo
4 shimla NaN NaN NaN NaN NaN NaN NaN
mirch
Veg
251 NaN NaN NaN NaN NaN NaN NaN
Kolhapuri
Vegetable
252 NaN NaN NaN NaN NaN NaN NaN
jalfrezi
df1.var()
Out[37]:
prep_time 5264.142288
cook_time 2329.572950
dtype: float64
localhost:8888/notebooks/AP19110010030_Assignment-2.ipynb 6/7
23/08/2021 AP19110010030_Assignment-2 - Jupyter Notebook
In [38]:
df1.std()
Out[38]:
prep_time 72.554409
cook_time 48.265650
dtype: float64
df1.cov()
Out[39]:
prep_time cook_time
df1.corr()
Out[40]:
prep_time cook_time
localhost:8888/notebooks/AP19110010030_Assignment-2.ipynb 7/7