Dsbda Ass3
Dsbda Ass3
Dsbda Ass3
Data Analytics
Laboratory
Third Year 2019 Course
Assignment No 3
Prof.K.B.Sadafale
Assistant Professor
Computer Dept. GCOEAR, Avasari
Descriptive Statistics - Measures of Central Tendency and variability
✔ print (df.describe())
print (df.describe(include=['object']))
print (df.describe(include='all'))
Example
Read csv “mtcars”
Output
# Get the mean of each column
mtcars.mean()()
Output
# Get the mean of each row
median
✔ The median of a distribution is the value where 50% of the
data lies below it and 50% lies above it.
✔ In essence, the median splits the data in half.
✔ The median is also known as the 50% percentile since
50% of the observations are found below it.
✔ you can get the median using the df.median() function:
✔ mtcars.median()
Mode
✔ The mode of a variable is simply the value that appears
most frequently.
print('iris-setosa')
setosa=data['target']=='Iris-setosa'
print(data[setosa].describe())
print('Iris-virginica')
setosa=data['target']=='Iris-virginica'
print(data[setosa].describe())
print('Iris- versicolor')
setosa=data['target']=='Iris- versicolor'
print(data[setosa].describe())