摘要:
#缺失值的处理from pandas import Seriesimport numpy as npstringSer=Series(['a','b',np.nan,'d','e'])#isnull 显示空值 stringSer.isnull()#notnull 显示非空值stringSer.not 阅读全文
摘要:
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) # 阅读全文
摘要:
import pandas as pdpivot_data=pd.read_excel('./data/data3.xlsx')pivot_data.head()pivot_data.describe(include='all').T import numpy as np#透视表 求进货价合计、平均 阅读全文
摘要:
import pandas as pddf2=pd.read_excel('./data/data2.xlsx',index_col='产品编码')df2.head()x=df2['供应商进货价']y=df2['销售价']from pylab import mplmpl.rcParams['font 阅读全文
摘要:
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 阅读全文