Using :
newdf3.pivot_table(rows=['Quradate'],aggfunc=np.mean)
which yields:
Alabama_exp Credit_exp Inventory_exp National_exp Price_exp Sales_exp
Quradate
2010-01-15 0.568003 0.404481 0.488601 0.483097 0.431211 0.570755
2010-04-15 0.543620 0.385417 0.455078 0.468750 0.408203 0.564453
I'd like to get the decimal numbers rounded to two digit and multiplied by 100 eg .568003 should be 57 been fiddling with it for a while to no avail; tried this
newdf3.pivot_table(rows=['Quradate'],aggfunc=np.mean).apply(round(2)) #and got:
TypeError: ("'float' object is not callable", u'occurred at index Alabama_exp')
Tried a number of other approaches to no avail most complain about the item not being a float... I see that the Pandas series object has a round method but DF does not I tried using df.apply but it complained about the float issue.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…