蓝绝

博客园 首页 新随笔 联系 订阅 管理
上一页 1 2 3 4 5 6 7 8 ··· 24 下一页

2022年11月27日 #

摘要: #散点图,设置标记样式 import matplotlib.pyplot as plt x=[1,2,3,4,5] y=[2,10,6,7,17] plt.plot(x,y,"r1") #r表示颜色,1表示标记样式(下花三角标记) plt.show() #折线图设置标记样式,,mfc='w'表示空心 阅读全文
posted @ 2022-11-27 15:55 蓝绝 阅读(75) 评论(0) 推荐(0) 编辑

摘要: #设置表颜色和线条灰度值 import matplotlib. pyplot as plt x=[1, 2, 3, 4, 5] y=[10, 20, 30, 40, 50] plt.plot(x,y,color='0.7',linestyle='-.') #设置灰度值为0.7,线条样式为-. plt 阅读全文
posted @ 2022-11-27 15:35 蓝绝 阅读(126) 评论(0) 推荐(0) 编辑

摘要: # 绘制简单图表 import matplotlib.pyplot as plt plt.plot([1,2,3,4,5]) plt.show() #散点图 import matplotlib.pyplot as plt plt.plot([1,2,3,4,5],[2,10,6,7,11],'ro' 阅读全文
posted @ 2022-11-27 14:23 蓝绝 阅读(22) 评论(0) 推荐(0) 编辑

摘要: import pandas as pd pd.set_option('display.unicode.east_asian_width',True) # 规整格式 df=pd.read_excel('电脑配件销售记录.xlsx') print(df.head()) df.to_html('电脑配件销 阅读全文
posted @ 2022-11-27 13:54 蓝绝 阅读(18) 评论(0) 推荐(0) 编辑

摘要: #移动窗口数据计算 import pandas as pd index=pd.date_range('2020-1-1',periods=15,freq='D') #创建Series对象 s=pd.Series(data=[3,6,7,4,2,1,3,8,9,10,12,15,13,22,14],i 阅读全文
posted @ 2022-11-27 13:26 蓝绝 阅读(43) 评论(0) 推荐(0) 编辑

摘要: #统计数据的open,close,high,low的值 import pandas as pd index=pd.date_range('2020-2-3',periods=12,freq='T') #从2020-2-3开始,12个数,间隔为1分钟 s=pd.Series(range(12),ind 阅读全文
posted @ 2022-11-27 13:03 蓝绝 阅读(24) 评论(0) 推荐(0) 编辑

摘要: import pandas as pd index=pd.date_range('2020-1-1',periods=2) s=pd.Series(range(1,3),index=index) #升采样 #s.resample('6H').asfreq() #使用前值填充 #s.resample( 阅读全文
posted @ 2022-11-27 12:47 蓝绝 阅读(17) 评论(0) 推荐(0) 编辑

摘要: import pandas as pd pd.set_option('display.unicode.east_asian_width',True) # 规整格式 df=pd.read_excel('msb课程记录.xls') df=df.set_index('订单付款时间') #df.head() 阅读全文
posted @ 2022-11-27 11:40 蓝绝 阅读(19) 评论(0) 推荐(0) 编辑

摘要: #将一分钟时间序列转换成3分钟, index=pd. date_range('2021-1-1', periods=9, freq='T') s=pd.Series (data=range (9), index=index) #产生3分钟的序列, #s. resample (rule=' 3T', 阅读全文
posted @ 2022-11-27 11:08 蓝绝 阅读(93) 评论(0) 推荐(0) 编辑

摘要: # data_range()函数的使用 import pandas as pd pd.date_range("2021-1-1",periods=10,freq="W") DatetimeIndex(['2021-01-03', '2021-01-10', '2021-01-17', '2021-0 阅读全文
posted @ 2022-11-27 10:40 蓝绝 阅读(23) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 ··· 24 下一页