#日期数组days=[0,31,28,31,30,31,30,31,31,30,31,30,31]#判断闰年defis_leap(year):ifyear%4==0andyear%100!=0oryear%400==0:returnTruereturnFalse#判断日期是否合法defcheck_date(date):year=date//10000#取前四个数字month=date/100%100#取五六个数字day=date%100#取最后两个数字ifmonth<=0...
defcheck_johansen(df): '''df是包含两个序列的dataframe''' #进行Johansen协整检验 johansen_test=coint_johansen(df.values,det_order=0,k_ar_diff=1) #判断是否存在协整关系 ifjohansen_test.lr1[0]>johansen_test.cvt[0,1]:#5%显著性水平 returnTrue else: returnFalse statsmodels库的coint函数返回三个...
def concat_col_str_condition(df):# concat 2 columns with strings if the last 3 letters of the first column are 'pil' mask = df['col_1'].str.endswith('pil', na=False) col_new = df[mask]['col_1'] + df[mask]['col_2'] col_new.replace('pil', ' ', regex=True, ...
() reminder_date = datetime.strptime(reminder_date, '%Y-%m-%d') if now.date() == reminder_date.date(): message = MIMEText(body, 'plain') message['From'] = sender_email message['To'] = recipient_email message['Subject'] = subject server.sendmail(sender_email, recipient_email, ...
g. ["set datestyle to german", ...] reset: how connections should be reset when returned to the pool (False or None to rollback transcations started with begin(), the default value True always issues a rollback for safety's sake) failures: an optional exception class or a tuple of ...
ADT Date: Date(int year,int month,int day) #定义年月日 difference(Date d1,Date d2) #求d1和d2的日期差 plus(Date d,int n) #日期d后n天的日期 num_date(int year,int n) #计算year年第n天的日期 ADT是一种思想,也是一种组织程序的技术: ...
git config --global user.name userName git config --global user.email userEmail 分支122 标签97 Khaleel Al-Adhamifail on using rxcond on event handlers or ...60df9075天前 2466 次提交 提交 .devcontainer prettier (#4941) 2个月前 .github ...
main 35Branches148Tags Code Folders and files Name Last commit message Last commit date Latest commit lesteve DOC Fix plotly rendering inside JupyterLite (#31400) May 20, 2025 19a6e61·May 20, 2025 History 32,476 Commits .binder .circleci ...
(expiration_date, '%Y-%m-%d %H:%M:%S')# 计算证书剩余有效期天数delta = expiration_date - datetime.now()days_left = delta.days# 判断证书是否过期if days_left < 0:print("SSL证书已过期!")else:print("SSL证书有效期剩余{}天".format(days_left))# 测试函数check_certificate_expiration('example...
使用表格预测SDK需要安装额外依赖 pip安装brotlipy==0.7.0 certifi==2020.6.20 joblib==1.0.1 kaggle==1.5.12 Pillow py4j pycosat python-dateutil python-slugify ruamel_yaml text-unidecode threadpoolctl flask pandas==1.0.5 scikit-learn==0.23.2 lightgbm==2.2.3 catboost==0.24.1 xgboost==1.2.0 num...