pu369com

06 2023 档案

【如何三行代码下载指定的股票或者基金数据到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 阅读(27) 评论(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 阅读(103) 评论(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 阅读(232) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示