摘要: #缺失值的处理from pandas import Seriesimport numpy as npstringSer=Series(['a','b',np.nan,'d','e'])#isnull 显示空值 stringSer.isnull()#notnull 显示非空值stringSer.not 阅读全文
posted @ 2019-10-03 22:22 天天见和 阅读(173) 评论(0) 推荐(0) 编辑
摘要: import pandas as pddf1=pd.DataFrame({'key':['a','b','c'],'data1':range(3)})df2=pd.DataFrame({'key':['a','b','d'],'data2':range(3)})pd.merge(df1,df2) # 阅读全文
posted @ 2019-10-03 20:55 天天见和 阅读(479) 评论(0) 推荐(0) 编辑
摘要: import pandas as pdpivot_data=pd.read_excel('./data/data3.xlsx')pivot_data.head()pivot_data.describe(include='all').T import numpy as np#透视表 求进货价合计、平均 阅读全文
posted @ 2019-10-03 20:32 天天见和 阅读(151) 评论(0) 推荐(0) 编辑
摘要: import pandas as pddf2=pd.read_excel('./data/data2.xlsx',index_col='产品编码')df2.head()x=df2['供应商进货价']y=df2['销售价']from pylab import mplmpl.rcParams['font 阅读全文
posted @ 2019-10-03 20:03 天天见和 阅读(3359) 评论(0) 推荐(0) 编辑
摘要: import pandas as pd df1=pd.read_csv("./data/data1.csv",encoding='gbk',index_col='产品编码')print(df1.head())#获得数据print(len(df1))print(df1.index.size)#求均值m 阅读全文
posted @ 2019-10-03 19:37 天天见和 阅读(274) 评论(0) 推荐(0) 编辑