The correct answer is: C. DataFrame.plot
The DataFrame.plot
method can be used to create a variety of plots, including scatter plots. To create a scatter plot matrix, you can use the kind='scatter'
argument. For example, the following code creates a scatter plot matrix for the iris
dataset:
“`
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv(‘iris.csv’)
df.plot(kind=’scatter’)
plt.show()
“`
This will produce a plot with one subplot for each of the four features in the iris
dataset. The points in each subplot will be colored according to the species of the flower.
The sca_matrix
and scatter_matrix
methods are also available, but they are deprecated in favor of the DataFrame.plot
method.