0
0
Data Analysis Pythondata~10 mins

Essential libraries overview (Pandas, NumPy, Matplotlib) 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 import the Pandas library with the common alias.

Data Analysis Python
import [1] as pd
Drag options to blanks, or click blank then click option'
Anumpy
Bmatplotlib
Cpandas
Dseaborn
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'numpy' instead of 'pandas'.
Using 'matplotlib' which is for plotting.
Using 'seaborn' which is another plotting library.
2fill in blank
medium

Complete the code to create a NumPy array from a Python list.

Data Analysis Python
import numpy as np
arr = np.[1]([1, 2, 3, 4])
Drag options to blanks, or click blank then click option'
Aarray
Bseries
Cmatrix
Dlist
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'list' which is a Python type, not a NumPy function.
Using 'matrix' which is a different NumPy type.
Using 'series' which is from Pandas.
3fill in blank
hard

Fix the error in the code to plot a simple line graph using Matplotlib.

Data Analysis Python
import matplotlib.pyplot as plt
plt.[1]([1, 2, 3], [4, 5, 6])
plt.show()
Drag options to blanks, or click blank then click option'
Ascatter
Bplot
Chist
Dbar
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'scatter' which draws points, not lines.
Using 'hist' which draws histograms.
Using 'bar' which draws bar charts.
4fill in blank
hard

Fill both blanks to create a Pandas DataFrame from a dictionary and show its first rows.

Data Analysis Python
import pandas as pd
data = {'name': ['Anna', 'Bob'], 'age': [25, 30]}
df = pd.[1](data)
print(df.[2]())
Drag options to blanks, or click blank then click option'
ADataFrame
BSeries
Chead
Dtail
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Series' instead of 'DataFrame' to create the table.
Using 'tail()' instead of 'head()' to show rows.
5fill in blank
hard

Fill all three blanks to create a NumPy array, calculate its mean, and print the result.

Data Analysis Python
import numpy as np
arr = np.[1]([10, 20, 30, 40])
mean_value = arr.[2]()
print([3])
Drag options to blanks, or click blank then click option'
Aarray
Bmean
Cmean_value
Dmedian
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'median' instead of 'mean' to calculate average.
Printing 'arr' instead of the mean value.
Using 'Series' instead of 'array' to create the array.