0
0
Data Analysis Pythondata~10 mins

describe() for statistics in Data Analysis Python - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to get basic statistics of the DataFrame.

Data Analysis Python
stats = df.[1]()
Drag options to blanks, or click blank then click option'
Atail
Binfo
Cdescribe
Dhead
Attempts:
3 left
💡 Hint
Common Mistakes
Using info() instead of describe() which shows data types, not statistics.
Using head() or tail() which show rows, not statistics.
2fill in blank
medium

Complete the code to include statistics for all columns, including non-numeric ones.

Data Analysis Python
stats_all = df.describe([1]='all')
Drag options to blanks, or click blank then click option'
Ainclude
Bexclude
Cnumeric_only
Dall
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'all=True' which is not a valid argument.
Using 'numeric_only=True' which limits to numeric columns only.
3fill in blank
hard

Fix the error in the code to get statistics only for numeric columns.

Data Analysis Python
num_stats = df.describe([1]=True)
Drag options to blanks, or click blank then click option'
Anumeric_only
Bexclude
Cinclude
Dall
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'include=True' which includes all columns.
Using 'all=True' which is invalid.
4fill in blank
hard

Fill both blanks to create a dictionary of statistics for words longer than 3 letters.

Data Analysis Python
lengths = {word: [1] for word in words if len(word) [2] 3 }
Drag options to blanks, or click blank then click option'
Alen(word)
B>
C<
Dword
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' which selects shorter words.
Using 'word' instead of 'len(word)' which stores the word itself.
5fill in blank
hard

Fill all three blanks to create a filtered dictionary with uppercase keys and values greater than 0.

Data Analysis Python
result = { [1]: [2] for k, v in data.items() if v [3] 0 }
Drag options to blanks, or click blank then click option'
Ak.upper()
Bv
C>
Dk
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'k' instead of 'k.upper()' which does not change the key case.
Using '<' instead of '>' which filters values less than zero.