Re: [Numpy-discussion] NEP 32: Remove the financial functions from NumPy

2019-09-04 Thread Martin.Gfeller
Dear all As a user of Numpy in finance, I'm absolutely in favour of removing these functions. They're too domain-specific, not flexible and general enough for widespread use, and probably not easy to maintain. Best regards Martin ___

Re: [Numpy-discussion] array - dimension size of 1-D and 2-D examples

2018-01-09 Thread Martin.Gfeller
Hi Derek I have a related question: Given: a = numpy.array([[0,1,2],[3,4]]) assert a.ndim == 1 b = numpy.array([[0,1,2],[3,4,5]]) assert b.ndim == 2 Is there an elegant way to force b to remain a 1-dim object array? I have a use case where normally the

[Numpy-discussion] How to compare an array of arrays elementwise to None in

2017-07-19 Thread Martin.Gfeller
Thank you for your help! Sebastian, I couldn't agree more with someone's bug being someone else's feature! A fast identity ufunc would be useful, though. Actually, numpy.frompyfunc(operator.is_,2,1) is much faster than the numpy.vectorize approach - only about 35% slower on quick measurement

[Numpy-discussion] How to compare an array of arrays elementwise to None in Numpy 1.13 (was easy before)?

2017-07-17 Thread Martin.Gfeller
Dear all I have object array of arrays, which I compare element-wise to None in various places: >>> a = >>> numpy.array([numpy.arange(5),None,numpy.nan,numpy.arange(6),None],dtype=numpy.object) >>> a array([array([0, 1, 2, 3, 4]), None, nan, array([0, 1, 2, 3, 4, 5]), None], dtype=object) >>>