擅长:python、mysql、java
<p>此错误是由此代码段<code>X[variables].values</code>引起的。将<code>variables</code>转换为<code>list</code>,它是一个<code>range</code></p>
<p>顺便说一句,代码非常混乱。当<code>variables</code>已经是<code>range</code>时,为什么要调用<code>np.arange</code>?为什么要使用一定数量的列来索引行</p>
<p>从上面的注释可以看出,您认为是按列编号索引列,但实际上是索引行。如果您使用<code>loc`` or</code>iloc```来明确说明您试图索引的内容,那么其中一些混淆将被消除</p>