Python Pandas join aggregated tables -


i have data frame 2 columns: product_id , rating. i'm trying join 2 tables. 1 obtained from

a = data.groupby('product_id').count() 

the other one

b = data.groupby('product_id').mean() 

i'd have table has on columns the

product_id  count   mean 

try:

data.groupby('product_id').agg(['mean', 'count']) 

Comments

  1. Wonderful article. I really appreciate how you addressed major problematic areas of concern to hiring a full-stack engineer in an enterprise. While training my hiring teams to hire the right professionals, I came across a wonderful platform, Eiliana.com. It was a great experience to hire a talent pool through easy-conveying of the requirements to the emerging platform offering services to business communities like us.

    ReplyDelete

Post a Comment

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -