我正在尝试从指南中运行以下代码,但我不知道为什么会出现此错误。阅读此类错误会强调问题出在哪里(反斜杠),但我不确定如何解决此问题。
x_range = [dataset['RM'].min(),dataset['RM'].max()]
y_range = [dataset['target'].min(),dataset['target'].max()]
scatter_plot = dataset.plot(kind='scatter', x='RM', y='target', \xlim=x_range, ylim=y_range)
meanY = scatter_plot.plot(x_range, [dataset['target'].mean(),\ dataset['target'].mean()], '--' , color='red', linewidth=1)
meanX = scatter_plot.plot([dataset['RM'].mean(),\dataset['RM'].mean()], y_range, '--', color='red', linewidth=1)
将\xlim
更改为xlim
。
即更改:
scatter_plot = dataset.plot(kind='scatter', x='RM', y='target', \xlim=x_range, ylim=y_range)
收件人:
scatter_plot = dataset.plot(kind='scatter', x='RM', y='target', xlim=x_range, ylim=y_range)