Issue
#column #column2 #column3....#column10
A, 2010, 1231
A, 2011, 1235
A, 2012, 1233
A, 2014, 1234
A, 2015, 1231
B, 2010, 1423
B, 2011, 1423
Is there a code to find the average of column3 to 10 for A,B,... Z?
Solution
I am assuming that the table you're using is a pandas data frame. Let us say that the name of the data frame is df and the name of the first column is 'column 1'. I 've used first column because that is the one that contains values - A,B,---Z. Following code should help you out.
import pandas as pd
df.groupby(['column_name']).mean()
Answered By - KhanMonisAI
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.