![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
iupopu97
这个作者很懒,什么都没留下…
展开
-
Python常用代码
用frame切换创建页面Label固定界面for i in range(30): Label(self,text=i).grid(row=i,column=1) for i in range(13): Label(self,text=i+2,width=14).grid(row=0,column=i+2,sticky=(W,E)) lblue=() lhead=('OVERVIEW') l_dic={'OVERVIEW':(2,1),原创 2021-02-10 16:23:12 · 1249 阅读 · 1 评论 -
案例:日数据转周数据
运用采样频率将数据聚合ttcode = 'sh600519'data = assit_pdread_data(ttcode,'1d')[0]data['Date_Time'] = pd.to_datetime(data['Date_Time'], format='%Y/%m/%d') data.set_index(['Date_Time'], inplace=True)# 转周data['Date']=data.index # 将日期作为indexdf_hig = data原创 2021-02-26 18:05:26 · 1097 阅读 · 0 评论 -
案例:获取年度大于股价中位数的天数占比
案例留存import numpy as npimport pandas as pd## Clear#gcf().clf()plt.clf() # assit: def assit_pdread_data(_ttcode,_p_input):def assit_pdread_data(_ttcode,_p_input): if _p_input == '1d': _p = datetime.timedelta(days=1) elif _p_input == '60m':原创 2021-02-26 15:13:53 · 121 阅读 · 0 评论 -
案例修改:tkiner的界面切换
包含:· Button· Listbox· Textdef do_xxx(): print(1)def do_test(): print('testing...') root = tk.Tk()root.geometry("800x600+300+50")# Button 'b'b = tk.Button(root,text='Test',relief='groove',command=do_test)b.grid(column=1,row=1) # listbox原创 2021-02-23 13:18:37 · 358 阅读 · 0 评论