摘要: 1 import pandas 2 from matplotlib import pyplot 3 4 #设置中文字体 5 pyplot.rcParams['font.sans-serif']=['simhei'] #显示中文标签 6 pyplot.rcParams['axes.unicode_mi 阅读全文
posted @ 2020-06-09 13:09 misherry 阅读(1006) 评论(0) 推荐(0) 编辑
摘要: 1 import pandas 2 from matplotlib import pyplot 3 4 #设置中文字体 5 pyplot.rcParams['font.sans-serif']=['simhei'] #显示中文标签 6 pyplot.rcParams['axes.unicode_mi 阅读全文
posted @ 2020-06-09 13:08 misherry 阅读(424) 评论(0) 推荐(0) 编辑
摘要: 1 import pandas 2 from matplotlib import pyplot 3 excel=pandas.read_excel('填充日期.xlsx') 4 excel.sort_values(by='score',ascending=False,inplace=True) 5 阅读全文
posted @ 2020-06-09 11:23 misherry 阅读(427) 评论(0) 推荐(0) 编辑
摘要: 1 from datetime import * 2 today=datetime.today() 3 now=datetime.now() 4 5 #判断今天是星期几 6 today.isoweekday() 7 8 #计算一周以后是星期几 9 day=timedelta(days=7) 10 t 阅读全文
posted @ 2020-06-08 23:43 misherry 阅读(290) 评论(0) 推荐(0) 编辑
摘要: import pandas def price_3_to_7(a): return 3<=a<=7 def time_3_to_8(b): return 3<=b<=8 excel=pandas.read_excel('填充数据.xlsx',header=3,index_col='id') exce 阅读全文
posted @ 2020-06-08 12:47 misherry 阅读(877) 评论(0) 推荐(0) 编辑
摘要: 1 import pandas 2 excel=pandas.read_excel('填充数据.xlsx',header=3,index_col='id') 3 excel.sort_values(by=['worthy','price'],inplace=True,ascending=[True, 阅读全文
posted @ 2020-06-08 12:27 misherry 阅读(498) 评论(0) 推荐(0) 编辑
摘要: 1 import pandas 2 excel=pandas.read_excel('填充数据.xlsx',header=3,index_col='id') 3 excel['mutiply']=excel['store']*0.5 4 for i in excel.index: 5 excel[' 阅读全文
posted @ 2020-06-08 11:33 misherry 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 1 from turtle import * 2 bgcolor('red') 3 setup(800,500) 4 5 a={(-126,162):65,(-58,55):65,(-58,-48):65,(-126,-162):65,(-300,50):120} 6 def start(tuple 阅读全文
posted @ 2020-06-07 13:50 misherry 阅读(290) 评论(0) 推荐(0) 编辑
摘要: 1 #在pandas中如果一列出现nan,则会认为他是float类型 2 import pandas 3 from datetime import datetime,timedelta 4 5 #关于月份加一的函数 6 def add_month(d,md): 7 yd=md//12 8 m=d.m 阅读全文
posted @ 2020-06-07 13:31 misherry 阅读(362) 评论(0) 推荐(0) 编辑
摘要: 1 import pandas 2 #Series表示序列,可以表示行或者列 3 4 d={'x':100,'y':300,'z':400} 5 s1=pandas.Series(d) 6 #print(s1.index) #查看其中的索引 7 8 s1=pandas.Series([1,2,3], 阅读全文
posted @ 2020-06-07 13:09 misherry 阅读(251) 评论(0) 推荐(0) 编辑