Re: [Numpy-discussion] Best fit linear piecewise function?

2021-06-07 Thread Chris Barker
On Thu, Jun 3, 2021 at 4:43 AM Klaus Zimmermann wrote: > if you are interested in the 1d problem, you might also consider a > spline fit of order 1, for example with scipy.interpolate, see [1]. > hmm, yes, that should work -- I guess it didn't dawn on me because all examples are higher order, bu

Re: [Numpy-discussion] Best fit linear piecewise function?

2021-06-07 Thread Chris Barker
On Thu, Jun 3, 2021 at 4:13 AM Mark Bakker wrote: > My students are using this and seem to like it: > > https://jekel.me/piecewise_linear_fit_py/about.html > thanks -- that looks perfect! -CHB > > >> Date: Tue, 1 Jun 2021 17:22:52 -0700 >> From: Chris Barker >> To: Discussion of Numerical P

[Numpy-discussion] Tensor Typing presentation and discussion on Wednesday! (As part of the NumPy Community Meeting)

2021-06-07 Thread Sebastian Berg
Hi all, There will be a NumPy Community meeting Wednesday June 9th at 20:00 UTC. This meeting will be dedicated to a presentation by Matthew and Pradeep about typing arrays. The title is: "Better types for numerical computing - arrays generic in dtype and shape" Abstract: An overview of why mo

Re: [Numpy-discussion] numpy histogram data

2021-06-07 Thread Keith Sloan
Thanks Okay trying to understand the data being returned. I have counts, bins = np.histogram(RedEllipticalMasses['Z_1'],bins=80) If I print lengths I get RedEllipticalMasses is 2514 bins = 81 and counts is 5 ( It is 5 Arrays each of length 80) Okay I can get centers with centers = 0.5 * (bins[

[Numpy-discussion] Accepting NEP 35 `like=array_like` for use with `__array_function__`

2021-06-07 Thread Sebastian Berg
Hi all, I have opened a PR (https://github.com/numpy/numpy/pull/19188) to *finalize* NEP 35: https://numpy.org/neps/nep-0035-array-creation-dispatch-with-array-function.html Which added `like=` keyword argument to `np.array`, `np.asarray`, `np.arange`, etc. as final. The previous acceptance ma

Re: [Numpy-discussion] RFC: supporting complex inputs in np.logaddexp

2021-06-07 Thread Ralf Gommers
On Tue, Jun 1, 2021 at 3:18 PM Filippo Vicentini wrote: > Hello all, > > I would like to ask if the maintainers would be in favour of adding > support to np.logaddexp in order to support complex numbers. > scipy.special.logsumexp already does, and it would be relatively > straightforward to suppo

Re: [Numpy-discussion] numpy histogram data

2021-06-07 Thread Doug Davis
Keith Sloan writes: > Thanks > > Not sure where I get centers & edges from Every time you call np.histogram the second return will be an array of edges; so you define centers anywhere after your first np.histogram call, e.g. with your bins1 variable. (I can't tell if this is exactly the case, bu

Re: [Numpy-discussion] numpy histogram data

2021-06-07 Thread Keith Sloan
Thanks Not sure where I get centers & edges from # Plot of Histogram of Stacked Counts of Red elliptical Galaxies versus Red Shift REMrange1 = RedEllipticalMasses[RedEllipticalMasses[RedEllipticalMasses['uminusr']>1.8]['uminusr'] <2.0] print(len(REMrange1)) counts1, bins1 = np.histogram(REMra