0
望着lmplot
documentation,它显示如何使用熊猫数据帧在Seaborn数据参数lmplot
参数:
x, y : strings, optional Input variables; these should be column names in data. data : DataFrame Tidy (“long-form”) dataframe where each column is a variable and each row is an observation.
我有一个熊猫据帧customers
,我想用作lmplot
的参数。如何将我的熊猫数据框转换为用于lmplot
的整洁(“长形”)数据框?
目前,我正在努力做到以下几点:
sns.lmplot(customers["Length of Membership"], customers["Yearly Amount Spent"], customers)
(Seaborn被导入为sns
)。上面的python代码返回一个包含很长浮点列表的错误。
看起来像第一有两个参数(x和y)预计将字符串,但你传递两个系列。试试'sns.lmplot(“会员长度”,“每年消费金额”,客户)'' –