本帖最后由 keshun 于 2020-11-1 23:34 编辑
- # ! -*- coding:utf-8
- import pandas as pd
- import requests
- import json, time, re, os
- import numpy as np
- from datetime import datetime
-
- api_url = "https://www"
- html = requests.get(api_url)
- datas = pd.DataFrame()
- for i in json.loads(html.text)["data"]["asks"]:
- df_insert = pd.DataFrame(
- {'a': i[0], 'b': i[1], 'c': i[2]}, index=[0])
- datas = datas.append(df_insert)
-
- print(datas)
- input("暂停")
复制代码 20元有偿求助高手修改代码,提取['data']['asks']与['data']['bids']下的3列纯数字串,谢谢! |