-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Open
Labels
EnhancementReduction Operationssum, mean, min, max, etc.sum, mean, min, max, etc.Windowrolling, ewma, expandingrolling, ewma, expanding
Description
A "weights" labeled parameter in the df.mean method would be extremely useful. In numpy this functionality is provided via np.average instead of np.mean which I'm assuming is how similar functionality would be added to pandas.
ex requested feature:
> a = np.array([[2,4,6],[8,10,12]])
> w = [.5, 0, .5]
> np_avg = np.average(a, weights = w, axis=1)
#output -> array([ 4., 10.])
> pd_avg = pandas.DataFrame(a).mean(weights = w, axis=1)
#desired output -> series with entries 4 and 10
If this is a desired feature I'll complete this and submit a pull request if desired. If this is somewhere already I've overlooked, my apologies, I've tried to look thoroughly.
firegate22, JacekPliszka, AdeelK93, Demetrio92, sv1990 and 2 more
Metadata
Metadata
Assignees
Labels
EnhancementReduction Operationssum, mean, min, max, etc.sum, mean, min, max, etc.Windowrolling, ewma, expandingrolling, ewma, expanding