[Numpy-discussion] interval wrapping / remainder / angle normalization
Hi everyone! I was wondering if it is a possible addition to numpy to have a function to wrap values to an interval. Typically, it is desired to limit an angle to [0, 2pi) or [-pi ,pi), either by letting it "overflow" or by "bouncing" hence and forth. The function which does this is actually really simple. However, whenever I am facing this task I tend to work a while on this until I get it correct. I have a small and handy function (it is small because it just uses np.divmod) at hand which does this, including also the left-open or closed cases, and some tests. In case this is of interest, I can contribute. Best regards, Thomas. ___ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion
[Numpy-discussion] Newcomer's Meeting tomorrow!
Hi all! Tomorrow,* May 20, at 8pm UTC* we have a Newcomer's Meeting! This is an informal meeting with no agenda to ask questions, get to know other people and (hopefully) figure out ways to contribute to NumPy. Feel free to join if you are lurking around but found it hard to start contributing - we'll do our best to support you. If you wish to join on Zoom, use this link: https://zoom.us/j/6345425936 Hope to see you around! ** You can click this link to get the correct time at your timezone: https://www.timeanddate.com/worldclock/fixedtime.html?msg=NumPy+Newcomer%27s+Meeting&iso=20210520T20&p1=1440&ah=1 *** You can add the NumPy community calendar to your google calendar by clicking this link: https://calendar.google.com/calendar /r?cid=YmVya2VsZXkuZWR1X2lla2dwaWdtMjMyamJobGRzZmIyYzJqODFjQGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20 - Melissa ___ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion
Re: [Numpy-discussion] interval wrapping / remainder / angle normalization
I have similar needs, but for int array and integer interval (like -32768~32767), currently I'm using bitwise and/or (&/|) to do this trick. It will be nice if there is an optimized function, both for float and int -- Sent from: http://numpy-discussion.10968.n7.nabble.com/ ___ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion