小编mic*_*ele的帖子

Pandas.plotting 不显示图形

我正在学习“python机器学习简介”一书中的教程,我复制了以下代码:

#create dataframe from data in X_train
#label the colums using the strings in iris_dataset.features_names
iris_dataframe = pd.DataFrame(X_train, columns = iris_dataset.feature_names)
#create a scatter matrix from the dataframe, color by y_train
pd.plotting.scatter_matrix(iris_dataframe,c=y_train,
                           figsize=(15,15), marker='o', 
                           hist_kwds={'bins':20},s=60, 
                           alpha=.8,
                           cmap=mglearn.cm3)
Run Code Online (Sandbox Code Playgroud)

它应该绘制一个图形,但它只打印这些行:

array([[<matplotlib.axes._subplots.AxesSubplot object at 0x7f0d073934a8>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x7f0d07352908>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x7f0d07376e48>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x7f0d0732ee48>],
       [<matplotlib.axes._subplots.AxesSubplot object at 0x7f0d072e3f28>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x7f0d072e3f60>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x7f0d07308ac8>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x7f0d07211400>],
       [<matplotlib.axes._subplots.AxesSubplot object at 0x7f0d071ca470>,
        <matplotlib.axes._subplots.AxesSubplot object at 0x7f0d07183470>,
        <matplotlib.axes._subplots.AxesSubplot object …
Run Code Online (Sandbox Code Playgroud)

python machine-learning matplotlib pandas

3
推荐指数
1
解决办法
8567
查看次数

标签 统计

machine-learning ×1

matplotlib ×1

pandas ×1

python ×1