Amazon Interview Question | What all information you get from describe() in python?
Question
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
It will take less than 1 minute to register for lifetime. Bonus Tip - We don't send OTP to your email id Make Sure to use your own email id for free books and giveaways
Answers ( 3 )
1)For Numerical values, you get the following
count – The total no of rows
unique – The no of unique values
top – top is the most common value
freq – freq is the frequency of the most common value
mean – the avg of all the values in respective columns
std – The standard deviation of that particular series
min – minimum value of the series
max – maximum value of the series
25% – The value at 25th percentile
50% – The value at 50th percentile
75% – The value at 75th percentile
You can change the value of these percentile according to your requirement
by passing in adequate arguments in the describe() function.
2) For object data type, it will contain
-count
-unique
-top
-freq
The describe() function computes a summary of statistics pertaining to the DataFrame columns.
This function gives the mean, std and IQR values. And, function excludes the character columns and given summary about numeric columns. ‘include’ is the argument which is used to pass necessary information regarding what columns need to be considered for summarizing. Takes the list of values; by default, ‘number’.
object − Summarizes String columns
number − Summarizes Numeric columns
all − Summarizes all columns together (Should not pass it as a list value)
Describe() function is used to commute statistics summary i.e, it gives mean, standard deviation, Inter Quartile range in DataFrames.