print(7 % 3)
2
Which command loads Pandas?
A. import pandas as pd
B. import panda as pd
C. import pd
D. from pandas import *
import pandas as pd
Which command displays the plot?
A. plt.open()
B. plt.display()
C. plt.show()
D. plt.start()
plt.show()
What is the output of:
x = 5; print(x * 2 + 1)
11
print(10 > 5 and 2 > 3)
False
Which command shows the last 3 rows of a DataFrame?
A. df.tail(3)
B. df.start(3)
C. df.head(3)
D. df.first(3)
df.tail(3)
Which command creates a basic line plot?
A. plt.line()
B. plt.plot()
C. plt.graph()
D. plt.map()
plt.plot()
print(4 == 4)
True
What is the output?
x = 5
x + = 2
print(x)
7
How do you select a single column named “Age”?
A. df(Age)
B. df.[Age]
C. df["Age"]
D. Both B and C
df["Age"]
You want to see which columns in your dataset have higher or lower correlation with each other using colors. Which Seaborn function helps you do this?
A. sns.barplot()
B. sns.heatmap()
C. sns.boxplot()
D. sns.scatterplot()
sns.heatmap()
What is the output of
name = "Alex";
print("Hello", name)
HelloAlex
x = 3
while x > 0:
print(x)
x -= 1
A. 3
B. 3 2 1
C. 1 2 3
D. Infinite loop
3 2 1
Which function reads an Excel file?
A. pd.read_excel()
B. pd.import_excel()
C. pd.read_xlsx()
D. pd.open_excel()
pd.read_excel()
What is the purpose of plt.title("Graph Title")?
A. Add color
B. Add a title
C. Add a caption
D. Resize the plot
Add a title
What is the output of the string method:
case = "Contract Law";
print(case.lower())
contract law
for i in range(2):
print("Hi")
A. Hi
B. Hi Hi
C. Nothing
D. Error
Which command shows the number of rows and columns in a DataFrame?
A. df.size
B. df.shape
C. df.count()
D. df.length()
df.shape
You have two lists in Python:
x = [1, 2, 3, 4] y = [10, 20, 15, 25]
Which Matplotlib command will create:
a) A bar chart of x vs y?
b) A scatter plot of x vs y?
import matplotlib.pyplot as plt
plt.bar(x, y)
plt.scatter(x, y)
plt.show()
sum_val = 0
for i in range(10):
sum_val = sum_val + i
print(sum_val)
45