Re: [Numpy-discussion] Why are empty arrays False?

2017-08-18 Thread Eric Firing
On 2017/08/18 11:45 AM, Michael Lamparski wrote: Greetings, all.  I am troubled. The TL;DR is that `bool(array([])) is False` is misleading, dangerous, and unnecessary. Let's begin with some examples: >>> bool(np.array(1)) True >>> bool(np.array(0)) False >>> bool(np.array([0, 1])) ValueEr

Re: [Numpy-discussion] Why are empty arrays False?

2017-08-19 Thread Eric Firing
On 2017/08/19 7:18 AM, Michael Lamparski wrote: While there's no way to really reach out to the silent majority, I am going to at least make a github issue and summarize the points from this discussion there.  I'm glad to see that the general response so far has been that this seems actionable

Re: [Numpy-discussion] Why are empty arrays False?

2017-08-19 Thread Eric Firing
On 2017/08/19 10:26 AM, Michael Lamparski wrote: There will be opportunity for others to do the same on Github. Please; I live for discussions about pitfalls in language and library design! Thank you for your thoughtful discussion. Eric ___ NumPy-Di

Re: [Numpy-discussion] Questions on np.piecewise

2017-09-15 Thread Eric Firing
On 2017/09/15 2:02 AM, Joe wrote: Hello, I have two questions and hope that you can help me. 1.) Is np.piecewise only defined for two conditions or should something like [0 < x <= 90, 90 < x <= 180, 180 < x <= 270] also work? 2.) Why does np.piecewise(np.array([50]), [0 < x <= 90, 90 < x <=

Re: [Numpy-discussion] Deprecate matrices in 1.15 and remove in 1.17?

2017-11-30 Thread Eric Firing
On 2017/11/30 12:00 PM, Stefan van der Walt wrote: I think Josef specifically meant `recarrays`, which give access to elements of a structured array via attribute access. I'd tend to agree with him that those turned out not to be such a great idea. But (I I have found recarrays to be useful, pr

Re: [Numpy-discussion] Introduction: NumPy developers at BIDS

2018-04-08 Thread Eric Firing
On 2018/04/07 9:19 PM, Stefan van der Walt wrote: We would love community input on identifying the best areas & issues to pay attention to, Stefan, What is the best way to provide this, and how will the decisions be made? Eric ___ NumPy-Discussion m

Re: [Numpy-discussion] Splitting MaskedArray into a separate package

2018-05-23 Thread Eric Firing
On 2018/05/23 9:06 AM, Matti Picus wrote: MaskedArray is a strange but useful creature. This NEP proposes to distribute it as a separate package under the NumPy brand. As I understand the process, a proposed NEP should be first discussed here to gauge general acceptance, then after that the de

Re: [Numpy-discussion] asarray/anyarray; matrix/subclass

2018-11-10 Thread Eric Firing
On 2018/11/10 12:39 PM, Stephan Hoyer wrote: On Sat, Nov 10, 2018 at 2:22 PM Hameer Abbasi > wrote: To summarize, I think these are our options: 1. Change the behavior of np.anyarray() to check for an __anyarray__() protocol. Change np.m

Re: [Numpy-discussion] new MaskedArray class

2019-06-24 Thread Eric Firing
On 2019/06/24 9:09 AM, Marten van Kerkwijk wrote: Another example of a function for which I think my model is not particularly insightful (and for which it is difficult to know what to do generally) is `np.fft.fft`. Since an fft is equivalent to a sine/cosine fits to data points, the answer for

Re: [Numpy-discussion] new MaskedArray class

2019-06-24 Thread Eric Firing
On 2019/06/24 11:39 AM, Marten van Kerkwijk wrote: Hi Eric, The easiest definitely is for the mask to just propagate, which that even if just one point is masked, all points in the fft will be masked. This is perfectly reasonable, and consistent with what happens with nans, of course. My su

Re: [Numpy-discussion] Adding keepdims to linspace / logspace / geomspace

2019-12-10 Thread Eric Firing
I wasn't sure whether the discussion would be on the list or on Github, so I posted to the latter: https://github.com/numpy/numpy/pull/14922#issuecomment-564211192 Eric On 2019/12/10 8:43 AM, Zijie Poh wrote: Hi all, We've created a PR (#14922 ) on

Re: [Numpy-discussion] Looking for a difference between Numpy 0.19.5 and 0.20 explaining a perf regression with Pythran

2021-03-12 Thread Eric Firing
On 2021/03/12 1:33 PM, PIERRE AUGIER wrote: arr.copy() or np.copy(arr) do not give the same result, with arr obtained from a Pandas dataframe with arr = df.values. It's strange because type(df.values) gives so I would expect arr.copy() and np.copy(arr) to give exactly the same result. Accor

[Numpy-discussion] Re: An article on numpy data types

2021-12-27 Thread Eric Firing
On 2021/12/27 9:32 AM, Lev Maximov wrote: > I'm surprised no one has mentioned it already: int and uint are reversed in the first table. Not anymore! I know I'm susceptible to this type of blunders ) Thank you for your kind attention! I've made a few more fixes here and there and added a coup

[Numpy-discussion] Re: An article on numpy data types

2021-12-28 Thread Eric Firing
On 2021/12/27 10:09 PM, Lev Maximov wrote: Btw, does it make sense to include the masked arrays? I know Pandas uses something like a masked array for representing null values in the integer columns. Does anyone use NumPy masked arrays nowadays? Yes, numpy masked arrays are very much in use,

[Numpy-discussion] Re: An article on numpy data types

2021-12-28 Thread Eric Firing
On 2021/12/28 10:54 AM, Lev Maximov wrote: On Wed, Dec 29, 2021 at 12:45 AM Eric Firing <mailto:efir...@hawaii.edu>> wrote: On 2021/12/27 10:09 PM, Lev Maximov wrote: > Btw, does it make sense to include the masked arrays? I know Pandas uses > something