擅长:python、mysql、java
<p>您可以将<code>[3]</code>作为参数传递给<code>skiprows</code>:</p>
<pre><code>In [100]:
t="""# comment
# comment
Header1;Header2
Unit1;Unit2
0;123
1;231
2;512"""
df = pd.read_csv(io.StringIO(t), sep=';', comment='#', skiprows=[3])
df
Out[100]:
Header1 Header2
0 0 123
1 1 231
2 2 512
</code></pre>
<p><strong>编辑</strong></p>
<p>对于初始版本,可以像以前一样读取csv,然后用<code>droplevel</code>覆盖列:</p>
^{pr2}$