- 博客(10)
- 收藏
- 关注
原创 【无标题】
原文链接:https://blog.csdn.net/m0_64335679/article/details/129975242pip install -i 国内镜像源地址 软件包名。- 中国科技大学 :https://pypi.mirrors.ustc.edu.cn/simple/- 清华:https://pypi.tuna.tsinghua.edu.cn/simple。- 阿里云:http://mirrors.aliyun.com/pypi/simple/
2023-05-09 00:00:55 56
原创 python 排列组合
python解决排列组合 - 一只小小的寄居蟹 - 博客园阅读目录笛卡尔积:itertools.product(*iterables[, repeat]) 排列:itertools.permutations(iterable[, r]) 组合:itertools.combinations(iterable, r) 组合(包含自身重复):itertools.combinations_with_replacement(iterable, r) 举例笛卡尔积:itertools.produc
2022-03-17 17:55:11 193
转载 python获取时间————前一天后一天前一小时后一小时前一分钟后一分钟前一秒后一秒
导入包 import datetime获取当天日期 now_time=datetime.datetime.now()print((now_time+datetime.timedelta(days=+1)).strftime("%Y-%m-%d %H:%M:%S")) #获取后一天print ((now_time+datetime.timedelta(hours=-1)).strftime("%Y-%m-%d %H:%M:%S")) #获取前一小时print(now_time.strftim.
2022-03-06 10:16:28 7188
原创 Statsmodels 统计包之 OLS 回归
import numpy as npimport matplotlib.pyplot as pltimport statsmodels.api as smfrom jqdatasdk import*auth("18958982268","LinMeng1992")#一元模型一次回归# Y=1+10⋅X.# nsample=100# x=np.linspace(0,10,nsample)# X=sm.add_constant(x)# beta=np.array([1,10])# e.
2022-02-06 13:46:38 1000
原创 读取xlsx内容 openpyxl
from openpyxl import Workbook,load_workbookfrom openpyxl.styles import *import warningswarnings.filterwarnings('ignore')wb = load_workbook('2020.xlsx')ws = wb['000']codelist = []for i in range(50): codelist.append(ws.cell(i+1, 1).value)print(.
2022-01-09 23:53:44 240
转载 Python创建二维数组的正确姿势
1 列表能创建多维数组?list_three = [[0 for i in range(3)] for j in range(3)]print(list_three)list_three[1][1] = 3print(list_three)[[0, 0, 0], [0, 0, 0], [0, 0, 0]][[0, 0, 0], [0, 3, 0], [0, 0, 0]]02 相比 List,NumPy 数组的优势NumPy 全称为 Numerical Python,是 Pytho
2021-12-07 23:00:50 1062
原创 xlsxwriter
import xlsxwriterworkbook = xlsxwriter.Workbook('火花学员信息')worksheet=workbook.add_worksheet()worksheetL1 = workbook.add_worksheet()worksheetL2 = workbook.add_worksheet()worksheetL3 = workbook.add_worksheet()worksheetL4 = workbook.add_worksheet()r1=[U
2021-12-03 23:28:17 121
原创 #获取A股所有股票代码
#获取A股所有股票代码class FinancialAnalysisSpider (scrapy.Spider): #定义Spider名称 name ='stocks_Analysis' #限制Spider爬取的域名 allowed_domains = ['www.eastmoney.com'] start_urls =['http://87.push2.eastmoney.com/api/qt/clist/get?cb=jQuery11240652656371.
2021-12-03 23:21:48 2336
原创 【无标题】获取一年的上班日期(股票开市的日子)
爬虫用,为了爬取每天股票数据从, 必须首先获取开市的日子 第一确保是工作日第二确保不是中国的节假日import calendarimport datetimefrom chinese_calendar import is_workday,is_holidayday=[]month=1for j in range(12): count=1 ds=calendar.monthrange(2021, month) #返回指定月份第一天是星期几,和本月有多少天 .
2021-12-03 22:54:01 175
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人