Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试从 api.trends() [Tweepy] 的 api 调用返回的 JSON 对象中提取数据,但我无法提取数据。
谁能给我一个如何从 JSON 对象中提取数据的示例。我想以表格形式提取数据。
提前致谢。
一旦你运行它,json.loads()它就会变成普通的 Python 对象。只需像对任何 dict 或列表一样对其进行索引。
json.loads()
>>> json.loads('{"foo": 42, "bar": "baz"}')[u'bar'] u'baz'