尝试生成熊猫配对图时的"TypeError: list indices must be integers or slices, not list"



我目前在为线性回归模型生成熊猫配对图时遇到问题。

我已经获得了我需要的数据,经过一些清理和编码,我正在尝试生成配对图。

目前我无法解决我看到的错误:

代码

our_columns = ["PLACE_CP6","RESULT_NOK"]
pd.plotting.scatter_matrix(
df_dummied[our_columns] ## Our dataframe with list of columns
, figsize=(10,10) ## Figure size - changes the size of the graph. Smaller number, smaller graph
, hist_kwds = {'bins': 10}
, alpha = 1  ## Settings for the keywords
, diagonal='hist'
)
plt.show()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-31-5c2cce38063e> in <module>
2 our_columns = ["PLACE_CP6","RESULT_NOK"]
3 pd.plotting.scatter_matrix(
----> 4           df_dummied[our_columns] ## Our dataframe with list of columns
5         , figsize=(10,10) ## Figure size - changes the size of the graph. Smaller number, smaller graph
6         , hist_kwds = {'bins': 10}
TypeError: list indices must be integers or slices, not list

关闭Jupyter并重新启动后,现在一切正常。

相关内容

最新更新