擅长:python、mysql、java
<p>正如您在html文件中看到的,应该有918行,但是您得到919行。具有单位定义的行被读取为第一个数据行,它会弄乱所有内容。这就是为什么您将第一个“ra”视为“decimal hr”而不是数字,并且列数据类型推断为dtype='str10'。你知道吗</p>
<p>可以使用“data\u start”参数放弃有问题的行:</p>
<pre><code>data = ascii.read("Ldwarf.html",
format="html",
encoding="ISO-8859-1",
data_start=2)
</code></pre>
<p>现在输入类型被正确地推断出来,用15乘以“ra”应该不会有任何问题。你知道吗</p>