pu369com

2023年6月9日

【如何三行代码下载指定的股票或者基金数据到pandas中】用pandas做爬虫

摘要: import pandas url="http://vip.stock.finance.sina.com.cn/quotes_service/view/cn_bill_sum.php?num=100&page=1&sort=totalvolpct&asc=0&volume=1000000&type= 阅读全文

posted @ 2023-06-09 18:07 pu369com 阅读(18) 评论(0) 推荐(0) 编辑

【python】用map和lambda根据if条件改变数组的值

摘要: 代码(数组ls中的元素,奇数前加v,偶数前加w): ls = [1,2,3,4] ls2 = map(lambda x:"v"+str(x) if x%2 == 1 else "w"+str(x) ,ls) print(list(ls2)) 输出: ['v1', 'w2', 'v3', 'w4'] 阅读全文

posted @ 2023-06-09 17:11 pu369com 阅读(86) 评论(0) 推荐(0) 编辑

新浪股票接口应用示例

摘要: import re import requests def market(st): market_code = "1" if st[0] == '6' else "0" return market_code + st gudaima = "sz000001" headers = {'referer' 阅读全文

posted @ 2023-06-09 16:46 pu369com 阅读(153) 评论(0) 推荐(0) 编辑

导航