擅长:python、mysql、java
<p>这个“奇怪的数据集”实际上是一种基于JSON的现有格式,称为<a href="http://jsonlines.org/" rel="nofollow noreferrer">JSONL</a></p>
<p>正如@user655321所说,您可以解析每一行。下面是一个更完整的示例,完整的数据集位于dicts<code>dataset</code>列表中:</p>
<pre class="lang-py prettyprint-override"><code>import json
dataset = []
with open("my_file.json") as file:
for line in file:
dataset.append(json.loads(line))
</code></pre>