DataFrame处理接口返回数据
import requests from pandas import DataFrame url = "***" payload = '***' headers = { 'Content-Type': 'application/x-www-form-urlencoded' } response = requests.request("POST", url, headers=headers, data=payload).json() print(response.keys()) ''' dict_keys(['totalPages', 'totalCount', 'nextPage', 'result']) ''' res_list = DataFrame(response["result"],columns=["name","id"]) print(res_list) ''' name id 0 name1 1331372814151570241 1 name2 1331372814215670256 '''
本文来自博客园,作者:OTAKU_nicole,转载请注明原文链接:https://www.cnblogs.com/nicole-zhang/p/14417277.html