pandas 签名scatter_matrix方法 [英] The signature of pandas scatter_matrix method
本文介绍了 pandas 签名scatter_matrix方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Signature: pandas.scatter_matrix(frame, alpha=0.5, figsize=None, ax=None, grid=False, diagonal='hist', marker='.', density_kwds=None, hist_kwds=None, range_padding=0.05, **kwds)
Docstring:
Draw a matrix of scatter plots.
在此签名中,没有'c'参数,但是为什么我在虹膜分类练习中看到代码,如下所示:
In this signature, there is not a 'c' argument, but why I am seeing code in the iris classification exercise, as follows:
iris_dataframe = pd.DataFrame(X_train, columns=iris_dataset.feature_names)
grr = pd.scatter_matrix(iris_dataframe, c=y_train, figsize=(15,15), marker='0', hist_kwds={'bins': 20}, s=60, alpha=.8, cmap=mglearn.cm3)
请参阅"c = y_train"部分.
Please see the "c=y_train" part.
推荐答案
c=y_train
是将传递给matplotlib函数的关键字参数. Python使用签名中的**kwds
捕获它. c=y_train
将使用y_train
中的数据来指示数据点的颜色.
c=y_train
is a keyword argument that will get passed to the matplotlib functions. Python captures it using **kwds
in the signature. c=y_train
will use the data in y_train
to dictate the color of the data points.
这篇关于 pandas 签名scatter_matrix方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文