擅长:python、mysql、java
<p><code>pd.read_json</code>需要一个字符串。但是,<code>r.json()</code>返回一个dict对象。</p>
<p>在您的例子中,您应该通过查看<code>x.keys()</code>来探索返回的JSON对象的结构。这将产生<code>['count', '_links', 'teams']</code>。你可能对“团队”领域感兴趣。</p>
<p>因此,您应该执行以下操作:</p>
<pre><code>r = requests.get('http://api.football-data.org/v1/competitions/398/teams')
x = r.json()
df = pd.DataFrame(x['teams'])
print df
</code></pre>