[Numpy-discussion] Next Documentation team meeting

2023-06-05 Thread Mukulika Pahari
Hi all!

Our next Documentation Team meeting will happen on *Monday, June 5* at
***4PM UTC***. We now alternate the meeting times to be a bit more
inclusive. This means that we'll have a meeting at 12pm UTC every 28 days,
and a meeting at 4pm UTC every 28 days.

All are welcome - you don't need to already be a contributor to join. If
you have questions or are curious about what we're doing, we'll be happy to
meet you!

If you wish to join on Zoom, use this (updated) link:

https://numfocus-org.zoom.us/j/85016474448?pwd=TWEvaWJ1SklyVEpwNXUrcHV1YmFJQ...

Here's the permanent hackmd document with the meeting notes (still being
updated):

https://hackmd.io/oB_boakvRqKR-_2jRV-Qjg

Hope to see you around!

* You can also visit https://scientific-python.org/calendars to add the
NumPy community calendar as an .ics file to your preferred calendar
manager. *

Best wishes,
Mukulika
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: mean_std function returning both mean and std

2023-06-05 Thread Ronald van Elburg
I had a look at what it would take to improve the C-solution. However I find 
that it is beyond my C-programming skils. 

The gufunc defintion seems to be at odds with current working of the axis 
keyword for mean, std and var. The latter support computation over multiple 
axes, whereas the gufunc only seems to support calculation over a single axis.  
As the behaviour of std, mean and var is largely inherited from ufuncs those 
might offer a better starting point.

If the operator used in the ufunc could take a parameter from the outer_loop 
accessing in this case the mean, then it would be possible to calculate the 
required intermediate quantities. This should be a possibility as somewhere the 
out array is also accessed in the correct manner and we should step through 
both arrays in the same way.

Instead of:

'''Pseudocode
result = np.full(result_shape, op.identity) # op = ufunc

loop_outer_axes_result_array:
loop_over_inner_axes_input_array:
result[outer_axes] = op(result[outer_axes],
InArray[outer_axes + inner_axes])
'''

we would then get:


'''Pseudocode
result = np.full(result_shape, op.identity) # op = ufunc

loop_outer_axes_result_array:
loop_over_inner_axes_input_array:
result[outer_axes] = op(result[outer_axes],
InArray[outer_axes + inner_axes],
ParameterArray[outer_axes])
'''

Using for op:

'''Pseudocode
op(a,b,c) = a+b-c
'''

and for b the original data and for c the mean (M_1) you would obtain the Neely 
correction for the mean.

Similarly using:

'''Pseudocode
op(a,b,c) = a+(b-c)^2
'''
you would obtain the sum of squared errors.
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: mean_std function returning both mean and std

2023-06-05 Thread Ronald van Elburg
Note: the suggested solution requires no allocation of memory beyond that 
needed for storing the result.
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: mean_std function returning both mean and std

2023-06-05 Thread Ronald van Elburg
2nd note: I implicit based this on the reduce function.
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com