0
0
Data Analysis Pythondata~10 mins

Basic DataFrame info (shape, dtypes, describe) 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 the number of rows and columns in the DataFrame.

Data Analysis Python
print(df.[1])
Drag options to blanks, or click blank then click option'
Acolumns
Bshape
Cinfo
Ddtypes
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'columns' returns only the column names, not the shape.
Using 'dtypes' returns data types, not the size.
2fill in blank
medium

Complete the code to see the data types of each column in the DataFrame.

Data Analysis Python
print(df.[1])
Drag options to blanks, or click blank then click option'
Adtypes
Bshape
Cdescribe
Dhead
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'shape' returns size, not data types.
Using 'describe' gives statistics, not data types.
3fill in blank
hard

Fix the error in the code to get summary statistics of the DataFrame.

Data Analysis Python
summary = df.[1]()
Drag options to blanks, or click blank then click option'
Adtypes
Bshape
Cinfo
Ddescribe
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'info' gives info about the DataFrame but not statistics.
Using 'shape' is an attribute, not a method.
4fill in blank
hard

Fill both blanks to create a dictionary with word lengths 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 '>' filters wrong words.
Using 'word' as value stores the word, not its length.
5fill in blank
hard

Fill all three blanks to create a 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.lower()
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'k.lower()' makes keys lowercase, not uppercase.
Using '<' instead of '>' filters wrong values.