擅长:python、mysql、java
<p>我不是100%确定,但第72016行的url数据(当通过pandas读取时)或api在通过read_csv方法读取时返回72016行似乎存在一些问题</p>
<p>因为当我在读取csv时跳过10000行时,在输出中我只能读取62016行。<br/>
(如果read_csv有任何限制,那么我应该从10001行得到72016行)</p>
<pre><code>urld = "https://api.coronavirus.data.gov.uk/v2/data?areaType=msoa&metric=newCasesBySpecimenDateRollingSum&format=csv"
url_c = pd.read_csv(urld, skiprows=10000, nrows=999999)
url_c.shape
Output is (62016, 11)
</code></pre>
<p>类似地,当我阅读72015行时,我只能阅读一行</p>
<pre><code>url_c = pd.read_csv(urld, skiprows=72015, nrows=999999)
url_c.shape
Output is (1, 11)
</code></pre>
<p>正如所料,当尝试从第72017行读取csv时,收到EmptyDataError</p>
<pre><code>url_c = pd.read_csv(urld, skiprows=72017, nrows=999999)
EmptyDataError: No columns to parse from file
</code></pre>