临时


    # 如果类型不对sum()就会拼接
    df[u'assetvalue'] = df[u'assetvalue'].astype('float64')
    # print df
    data = df[u'assetvalue'].groupby((df[u'compname'], df[u'parentname'], df[u'parentcode'],df[u'assessdate']))
    print data.sum()
    print data.sum().to_excel('./e.xlsx')

# 修改或者获取某一列中的某条件的值
#修改 :
 fundinfo_total.loc[fundinfo_total[u'fundcode'] == fund, 'compname'] = '666666'
# 获取:
print fundinfo_total.loc[fundinfo_total[u'fundcode'] == fund, 'compname']

你可能感兴趣的:(临时)