[NumPy-Tickets] [NumPy] #1858: a function einmean based on einsum
NumPy Trac
numpy-tickets@scipy....
Tue Jun 7 09:43:55 CDT 2011
#1858: a function einmean based on einsum
--------------------------+-------------------------------------------------
Reporter: wieland | Owner: somebody
Type: enhancement | Status: new
Priority: low | Milestone: Unscheduled
Component: numpy.core | Version: 1.6.0
Keywords: mean, einsum |
--------------------------+-------------------------------------------------
I suggest a new function 'einmean' that is almost equal to 'einsum' but
divides by the number of elements it summed over.
Example:
{{{
>>> a = np.arange(25).reshape(5,5)
>>> np.einsum('ii', a)
60
>>> np.einsum('ii', a)/5.
12
>>> np.einmean('ii', a)
12
}}}
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1858>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list