Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas average of vectors after groupby

# credit to the Stack Overflow user in source link
# vector is the label of a column containing fixed - size numpy (np) array
df.groupby('your_label')['vector'].apply(np.mean)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #average #vectors #groupby
ADD COMMENT
Topic
Name
7+4 =