Re: [Numpy-discussion] Integers to negative integer powers, time for a decision.

2016-10-07 Thread Alan Isaac
On 10/7/2016 9:12 PM, Charles R Harris wrote: *Always return a float * /Pluses/ * Computational convenience Is the behavior of C++11 of any relevance to the choice? http://www.cplusplus.com/reference/cmath/pow/ Alan Isaac ___ NumPy-Discussion

[Numpy-discussion] coordinate bounds

2016-08-20 Thread Alan Isaac
Is there a numpy equivalent to Mma's CoordinateBounds command? http://reference.wolfram.com/language/ref/CoordinateBounds.html Thanks, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/

Re: [Numpy-discussion] weighted random choice in Python

2016-08-16 Thread Alan Isaac
On 8/16/2016 4:06 AM, Ralf Gommers wrote: The whole enhancement request doesn't look very interesting imho. Because the functionality is already in NumPy, or because it is easily user-written? Alan ___ NumPy-Discussion mailing list

[Numpy-discussion] weighted random choice in Python

2016-08-15 Thread Alan Isaac
heers, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Picking rows with the first (or last) occurrence of each key

2016-07-03 Thread Alan Isaac
]) if (k not in seen): result.append(datum) seen.add(k) if invert: result.reverse() return result Cheers, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-21 Thread Alan Isaac
On 6/20/2016 5:59 PM, Nathaniel Smith wrote: If you have the time to check for existing bug reports about this, and file a new bug if you don't find one, then it'd be appreciated. https://github.com/numpy/numpy/issues/7770 Alan ___ NumPy-

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-20 Thread Alan Isaac
ype('int8') >>> (np.int64(2**7)*np.arange(5,dtype=np.int8)).dtype dtype('int16') fwiw, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-20 Thread Alan Isaac
in advance to anyone who can help me understand better the issues in play. Cheers, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-13 Thread Alan Isaac
nt8(2)**2) >>> type(np.uint64(2)**np.int8(2)) I don't think anyone has proposed first principles from which the desirable behavior could be deduced. I do think reference to the reasoning used by other languages in making this decision could be helpful.

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-10 Thread Alan Isaac
have argued a**2 should produce an int32 when a is an int32: what if a is an int8? (Obviously the overflow problem is becoming extremely pressing ...) Thanks, Alan PS Where are these casting rules documented? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-10 Thread Alan Isaac
ats provides a better match to Python's behavior (i.e., it allows sensible handling of negative powers). Users who really want in output and understand overflow should be supported with a function. Anyway, I've said my piece and will shut up now. Cheers, Alan

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-10 Thread Alan Isaac
://wiki.haskell.org/Power_function http://stackoverflow.com/questions/6400568/exponentiation-in-haskell Alan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-10 Thread Alan Isaac
On 6/10/2016 1:20 PM, Ian Henriksen wrote: forcing float output for people who actually want integers is not at all ideal Yes, there definitely should be a function supporting this. Alan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-10 Thread Alan Isaac
ntext. Is 2**40 a "large power"? Finally, is np.arange(1,3)**-2 "innocent looking" to a Python user? Cheers, Alan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-05 Thread Alan Isaac
the real question is whether it is strong enough tosacrifice backwards compatibility. Hope this summary is of some use and not too tendentious, Alan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Integers to integer powers

2016-05-24 Thread Alan Isaac
On 5/24/2016 3:57 PM, Eric Moore wrote: Changing np.arange(10)**3 to have a non-integer dtype seems like a big change. What about np.arange(100)**5? Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org

Re: [Numpy-discussion] Integers to integer powers

2016-05-24 Thread Alan Isaac
inly be used by beginners. Alan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Integers to integer powers

2016-05-24 Thread Alan Isaac
? Having (**) actually work seems worth quite a lot. Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Integers to integer powers

2016-05-24 Thread Alan Isaac
On 5/24/2016 1:19 PM, Stephan Hoyer wrote: the int ** 2 example feels quite compelling to me Yes, but that one case is trivial: a*a And at least as compelling is not have a**-2 fail and not being tricked by say np.arange(10)**10. The latter is a promise of hidden errors. Alan

Re: [Numpy-discussion] Integers to integer powers

2016-05-24 Thread Alan Isaac
("usually") overflow - a numpy function cd meet specialized exponentiation needs Thanks, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Integers to integer powers

2016-05-20 Thread Alan Isaac
Yes, I was referring to `pow`, but I had in mind the C++ version, which is overloaded: http://www.cplusplus.com/reference/cmath/pow/ Cheers, Alan On 5/20/2016 4:27 PM, Warren Weckesser wrote: C doesn't have an exponentiation operator. The C math library has pow, powf and powl, which

Re: [Numpy-discussion] Integers to integer powers

2016-05-20 Thread Alan Isaac
f the possible input pairs overflow the type. My core inclination would be to use (what I understand to be) the C convention that integer exponentiation always produces a double, but to support dtype-specific exponentiation with a function. But this is just a user's perspective. Cheers,

Re: [Numpy-discussion] ndarray.T2 for 2D transpose

2016-04-08 Thread Alan Isaac
On 4/8/2016 5:13 PM, Nathaniel Smith wrote: he doesn't want 2d matrices, he wants tools that make it easy to work with stacks of 2d matrices stored in 2-or-more-dimensional arrays. Like `map`? Alan Isaac ___ NumPy-Discussion mailing list

Re: [Numpy-discussion] ndarray.T2 for 2D transpose

2016-04-08 Thread Alan Isaac
is a perceived need ... Cheers, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] ndarray.T2 for 2D transpose

2016-04-06 Thread Alan Isaac
more keystrokes. (It's still horribly ugly, though, and I hope this too is dismissed.) Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] ndarray.T2 for 2D transpose

2016-04-05 Thread Alan Isaac
`, would be the same as `ndarray.transpose(True)`. Use `dot`. E.g., m.dot(a) hth, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] proposal: new logspace without the log in the argument

2016-02-18 Thread Alan Isaac
such a new function correct the apparent mistake (?) of `linspace` including the endpoint by default? Or is the current API justified by its Matlab origins? (Or have I missed the point altogether?) If this query is annoying, please ignore it. It is not meant to be.

Re: [Numpy-discussion] making "low" optional in numpy.randint

2016-02-17 Thread Alan Isaac
On 2/17/2016 7:01 PM, Juan Nunez-Iglesias wrote: Notice the limitation "1D array-like". http://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.random.choice.html "If an int, the random sample is generated as if a was np.arange(n)&qu

Re: [Numpy-discussion] making "low" optional in numpy.randint

2016-02-17 Thread Alan Isaac
e. http://docs.scipy.org/doc/numpy-1.10.0/reference/generated /numpy.random.choice.html fwiw, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] making "low" optional in numpy.randint

2016-02-17 Thread Alan Isaac
at issue, not push for a change. I think citing non-existent standards is not helpful. I think the discrepancy between the Python standard library and numpy for a function going by a common name is harmful. (But then, I teach.) fwiw, Alan ___ NumPy

Re: [Numpy-discussion] making "low" optional in numpy.randint

2016-02-17 Thread Alan Isaac
about the user interface. Nobody is proposing changing the behavior of `range`. That is an entirely separate question. I'm not trying to change any minds, but let's not rely on spurious arguments. Cheers, Alan ___ NumPy-Discussion mail

Re: [Numpy-discussion] making "low" optional in numpy.randint

2016-02-17 Thread Alan Isaac
On 2/17/2016 11:46 AM, Robert Kern wrote: some at least are 1-based indexing, so closed intervals do make sense. Haskell is 0-indexed. And quite carefully thought out, imo. Cheers, Alan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] making "low" optional in numpy.randint

2016-02-17 Thread Alan Isaac
posed name (after `randint` deprecation): `randints`. Cheers, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Behavior of np.random.uniform

2016-01-19 Thread Alan G Isaac
In principle, if we are describing an *interval*, that is the right thing to do: https://en.wikipedia.org/wiki/Interval_(mathematics)#Including_or_excluding_endpoints Alan Isaac On 1/19/2016 9:21 AM, G Young wrote: Of the methods defined in *numpy/mtrand.pyx* (excluding helper functions and

Re: [Numpy-discussion] FeatureRequest: support for array construction from iterators

2015-11-27 Thread Alan G Isaac
On 11/27/2015 5:37 AM, Stephan Sahm wrote: I like to request a generator/iterator support for np.array(...) as far as list(...) supports it. http://docs.scipy.org/doc/numpy/reference/generated/numpy.fromiter.html hth, Alan Isaac ___ NumPy

Re: [Numpy-discussion] Backwards-incompatible improvements to numpy.random.RandomState

2015-05-24 Thread Alan G Isaac
than meant by "I think this is just a bug in the description of the proposal here, not in the proposal itself". So, is the correct phrasing "the global RandomState object should use the latest implementation of the methods, unless expli

Re: [Numpy-discussion] Backwards-incompatible improvements to numpy.random.RandomState

2015-05-24 Thread Alan G Isaac
numpy version number. This will allow everyone who wants to to change now, without requiring that users attend to minor numpy version numbers if they want replicability. I think this is what is required by semantic versioning. Alan Isaac On 5/24/2015 4:59 AM, Ralf Gommers wrote: > the reasoning

Re: [Numpy-discussion] Proposed deprecations for 1.10: dot corner cases

2015-05-11 Thread Alan G Isaac
at `@` would neither be bound by the behavior of `dot` nor expected to be reconciled with it. I agree that where `@` and `dot` differ in behavior, this should be clearly documented. I would hope that the behavior of `dot` would not change. Alan ___ Num

Re: [Numpy-discussion] Proposed deprecations for 1.10: dot corner cases

2015-05-11 Thread Alan G Isaac
rgument offered. As for the "logic" of the current behavior, can it not be given a tensor product motivation? (Otoh, it conflicts with the current behavior of `vdot`.) Alan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http

Re: [Numpy-discussion] On responding to dubious ideas (was: Re: Advanced indexing: "fancy" vs. orthogonal)

2015-04-09 Thread Alan G Isaac
> Alan wrote: >> 3. I admit, my students are NOT using non-boolen fancy indexing on >> >multidimensional arrays. (As far as I know.) Are yours? On 4/9/2015 2:22 AM, Nathaniel Smith wrote: > Well, okay, this would explain it, since integer fancy indexing is > exactly t

Re: [Numpy-discussion] On responding to dubious ideas (was: Re: Advanced indexing: "fancy" vs. orthogonal)

2015-04-09 Thread Alan G Isaac
On 4/9/2015 1:57 AM, Nathaniel Smith wrote: > Do you think there's anything we could be > doing to reduce this kind of adrenaline reaction while still allowing > for relaxed discussion about out-there ideas? numpy3...@scipy.org :-) ___ NumPy-Discussion

Re: [Numpy-discussion] On responding to dubious ideas (was: Re: Advanced indexing: "fancy" vs. orthogonal)

2015-04-08 Thread Alan G Isaac
non-boolen fancy indexing on multidimensional arrays. (As far as I know.) Are yours? Cheers, Alan On 4/8/2015 3:05 PM, Eric Firing wrote: > What sequence of steps might reduce the disconnect between numpy and the > rest of the array-handling world? And make it a little friendlier for >

Re: [Numpy-discussion] On responding to dubious ideas (was: Re: Advanced indexing: "fancy" vs. orthogonal)

2015-04-08 Thread Alan G Isaac
x27;s very reassuring. fwiw, Alan On 4/7/2015 9:06 PM, Nathaniel Smith wrote: > If a grad student or junior colleague comes to you with an > idea where you see some potentially critical flaw, do you > yell THAT WILL NEVER WORK and kick them out of your > office? Or, do you maybe ask a

Re: [Numpy-discussion] argument handling by uniform

2015-03-13 Thread Alan G Isaac
which matches the online help: http://docs.scipy.org/doc/numpy/reference/generated/numpy.random.uniform.html#numpy.random.uniform Thanks, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] argument handling by uniform

2015-03-13 Thread Alan G Isaac
Today I accidentally wrote `uni = np.random.uniform((-0.5,0.5),201)`, supply a tuple instead of separate low and high values. This gave me two draws (from [0..201] I think). My question: how were the arguments interpreted? Thanks, Alan Isaac

Re: [Numpy-discussion] Matrix Class

2015-02-11 Thread Alan G Isaac
the product unless forced to.) Cheers, Alan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Matrix Class

2015-02-11 Thread Alan G Isaac
Just recalling the one-year-ago discussion: http://comments.gmane.org/gmane.comp.python.numeric.general/56494 Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] The future of ndarray.diagonal()

2015-01-05 Thread Alan G Isaac
nicer NumPy, I cannot find any way to say MATLAB is "nicer". Cheers, Alan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] diag, diagonal, ravel and all that

2015-01-03 Thread Alan G Isaac
> On Sat, Jan 3, 2015 at 8:05 AM, Alan G Isaac wrote: >> Would this really be practicality beating purity? >> It would be nice to have know the principle governing this. >> For example, is there a way to convincingly group these as >> array oper

Re: [Numpy-discussion] diag, diagonal, ravel and all that

2015-01-03 Thread Alan G Isaac
`. Has anyone requested this? (I can see the argument for `diag`.) Alan Isaac On 1/2/2015 9:04 PM, Charles R Harris wrote: > The diag, diagonal, and ravel functions have recently been changed to > preserve subtypes. However, this causes lots of backward compatibility > problems >

[Numpy-discussion] should unpackbits take a dtype?

2014-12-09 Thread Alan G Isaac
As the question asks: should `unpackbits` add a dtype argument? At the moment I'm interest in unpacking as a boolean array. Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] divmod?

2014-12-06 Thread Alan G Isaac
Just wondering why there is no `np.divmod` corresponding to `ndarray.__divmod__`? (I realize one can just use `divmod`.) Couldn't the `out` argument be useful? Thanks, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

[Numpy-discussion] recover original array from unpackbits

2014-12-06 Thread Alan G Isaac
graph dimensions. (These are square to that is inferrable, but for general binary relations even that is not true.) I'm wondering how others approach this. Thanks, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.o

Re: [Numpy-discussion] packbits / unpackbits bugs or misfeatures?

2014-11-29 Thread Alan G Isaac
e than never?) More relevant at this point: it seems very odd that `packbits` does not *accept* a boolean array, even if it does not insist upon one. Might this be considered a bug? Cheers, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussi

Re: [Numpy-discussion] truthiness of object arrays

2014-11-13 Thread Alan G Isaac
On 11/13/2014 1:32 PM, Nathaniel Smith wrote: > I think you're being misled by buggy exception handling weirdness, > where the ValueError raised by calling __bool__ is getting delayed, > and then pre-empting the AttributeError that should be generated by > the call to __nonzero__. Aha! Thanks. _

Re: [Numpy-discussion] truthiness of object arrays

2014-11-13 Thread Alan G Isaac
On 11/13/2014 12:37 PM, Antony Lee wrote: > On Python3, __nonzero__ is never defined (always raises an AttributeError), > even after calling __bool__. The example I posted was Python 3.4.1 with numpy 1.9.0. fwiw, Alan Isaac Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC

Re: [Numpy-discussion] truthiness of object arrays

2014-11-13 Thread Alan G Isaac
;> t.__bool__() True >>> t.__nonzero__() ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Add `nrows` to `genfromtxt`

2014-11-01 Thread Alan G Isaac
On 11/1/2014 3:15 PM, Warren Weckesser wrote: > I intended the result of `genfromtxt(..., max_rows=n)` to produce the same > array as produced by `genfromtxt(...)[:n]`. I find that counterintuitive. I would first honor skip_header. Cheers

Re: [Numpy-discussion] Add `nrows` to `genfromtxt`

2014-11-01 Thread Alan G Isaac
same cost, why not? In that case, it is not really useful to speculate about use cases. If the costs are substantially greater, then that should be stated. Cost is a good reason not to do something. fwiw, Alan Isaac ___ NumPy-Discussion mailing l

Re: [Numpy-discussion] Add `nrows` to `genfromtxt`

2014-11-01 Thread Alan G Isaac
say `slice_rows=slice(500)`. Perhaps you could provide an example illustrating the issues this reply overlooks. Cheers, Alan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Why ndarray provides four ways to flatten?

2014-10-28 Thread Alan G Isaac
e to use". In particular, `flat` is much more elegant, and includes an automatic guarantee that the iterations will be in C-contiguous style. Alan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Why ndarray provides four ways to flatten?

2014-10-28 Thread Alan G Isaac
iagonal. (It can be sliced.) I don't recall the specifics at the moment, but I've been happy to have it in the past. Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] fsin on Intel

2014-10-10 Thread Alan G Isaac
This is not NumPy specific but may still interest list members: http://randomascii.wordpress.com/2014/10/09/intel-underestimates-error-bounds-by-1-3-quintillion/ Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http

Re: [Numpy-discussion] Add `nrows` to `genfromtxt`

2014-09-24 Thread Alan G Isaac
that more versatile than an `nrows` keyword for the number of rows would be a "rows" keyword for a slice argument. fwiw, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] SFMT (faster mersenne twister)

2014-09-05 Thread Alan G Isaac
On 9/5/2014 1:19 PM, Neal Becker wrote: > I think it's somewhat debatable whether generating a different sequence of > random numbers counts as breaking backward compatibility. Please: it does. Alan Isaac ___ NumPy-Discussion mailing

[Numpy-discussion] odd (?) behavior: negative integer scalar in exponent

2014-09-03 Thread Alan G Isaac
What should be the value of `2**np.int_(-32)`? It is apparently currently computed as `1. / (2**np.int_(32))`, so the computation overflows (when a C long is 32 bits). I would have hoped for it to be computed as `1./(2.**np.int_(32))`. Cheers, Alan Isaac

Re: [Numpy-discussion] Preliminary thoughts on implementing __matmul__

2014-08-06 Thread Alan G Isaac
his, can you please suggest for exploration a language that has adopted this approach. (Ideally, where the decision is considered a good one.) Thank you, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] numpy.mean still broken for largefloat32arrays

2014-07-25 Thread Alan G Isaac
uces the mean? And obviously, for any float data type, the mean value of the values in the array is representable as a value of the same type. Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listin

Re: [Numpy-discussion] numpy.mean still broken for large float32arrays

2014-07-24 Thread Alan G Isaac
, then it is a bug. Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] numpy.mean still broken for large float32 arrays

2014-07-24 Thread Alan G Isaac
r issues arise for `var` and `std`, etc. See http://www.johndcook.com/standard_deviation.html for some discussion and references. Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Short-hand array creation in `numpy.mat` style

2014-07-18 Thread Alan G Isaac
downside, this is only good for 2d, and there have been proposals for the new array builder to handle other dimensions. fwiw, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Numpy BoF at SciPy 2014 - quick report

2014-07-18 Thread Alan G Isaac
r. (Mathematica considers it an error.) Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Short-hand array creation in `numpy.mat` style

2014-07-07 Thread Alan G Isaac
27; to be 3d, or even '1 2;3 4;;5 6;7 8' (two 2d arrays), but I'm just noting that, not urging that it be implemented. Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Remove bento from numpy

2014-07-05 Thread Alan G Isaac
On 7/5/2014 6:42 PM, Ralf Gommers wrote: > What next, we give Alan Isaac commit rights and then it's OK to break > numpy.matrix when that's convenient? I always wondered what I would do with commit rights ... Alan ___ NumPy-Discuss

Re: [Numpy-discussion] should rint return int?

2014-04-28 Thread Alan G Isaac
On 4/28/2014 3:29 PM, Neal Becker wrote: > Well I'd spell it nint, and it works like: Wouldn't it be simpler to add a dtype argument to `rint`? Or does that violate the "simple wrapper" intent? Alan Isaac ___ NumPy-Discus

[Numpy-discussion] numerical gradient, Jacobian, and Hessian

2014-04-20 Thread Alan G Isaac
s seems like an excellent way forward. There was talk of making this a summer of code project, but that seems to have sputtered. Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] min depth to nonzero in 3d array

2014-04-17 Thread Alan G Isaac
ing nicely with its absence is even better.) Thanks, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] index partition

2014-04-14 Thread Alan G Isaac
ages (which would suggest using the set operations instead). In particular, might a[boolean_array] be slower that a[indexes]? (I'm just asking, not suggesting.) Thanks! Alan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.sc

[Numpy-discussion] index partition

2014-04-12 Thread Alan G Isaac
ero(a<=0). Can I get them both in one go? Thanks, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] boolean operations on boolean arrays

2014-04-12 Thread Alan G Isaac
) I somewhat expect the last column to be slowest as well as least convenient, since it is built to first convert non-booleans to booleans. Are there other differences? Also, is this made clear anywhere in the docs? Thanks, Alan Isaac ___ NumPy-Discussion mai

Re: [Numpy-discussion] Default builds of OpenBLAS development branch are now fork safe

2014-03-28 Thread Alan G Isaac
l projects". http://eigen.tuxfamily.org/index.php?title=Licensing_FAQ If you are correct in your interpretation, it may be worth raising the issue and requesting the needed accommodation. Alan ___ NumPy-Discussion mailing list NumPy-Dis

Re: [Numpy-discussion] NumPy-Discussion Digest, Vol 90, Issue 83

2014-03-26 Thread Alan G Isaac
On 3/25/2014 5:13 PM, Colin J. Williams wrote: > avoid the use of an additional operator which would only be used with numpy. http://legacy.python.org/dev/peps/pep-0465/#but-isn-t-matrix-multiplication-a-pretty-niche-requirement Alan Isaac ___ Nu

Re: [Numpy-discussion] why sort does not accept a key?

2014-03-24 Thread Alan G Isaac
On 3/24/2014 1:41 PM, Charles R Harris wrote: > For float types you would need to use the negative. Yes, that's all I could come up with. So ... shd `sort` have a `reverse` option, like Python's builtin? Alan ___ NumPy-Discussion maili

Re: [Numpy-discussion] why sort does not accept a key?

2014-03-24 Thread Alan G Isaac
> On Mon, Mar 24, 2014 at 12:08 PM, Alan G Isaac >> what is the preferred idiom for a descending sort? On 3/24/2014 12:13 PM, josef.p...@gmail.com wrote: > adding [::-1] just creates a new view, pretty low cost. I meant when you need to sort on a key (another vector). Curren

Re: [Numpy-discussion] why sort does not accept a key?

2014-03-24 Thread Alan G Isaac
> On Mon, Mar 24, 2014 at 11:32 AM, Alan G Isaac wrote: >> I'm wondering if `sort` intentionally does not accept >> a `key` >> or if this is just a missing feature? On 3/24/2014 11:47 AM, Alexander Belopolsky wrote: > It would be very inefficient to c

[Numpy-discussion] why sort does not accept a key?

2014-03-24 Thread Alan G Isaac
I'm wondering if `sort` intentially does not accept a `key` or if this is just a missing feature? (I suppose that if the `order` argument is specified it would have to accept a sequence of keys ...) Thanks, Alan Isaac ___ NumPy-Discussion mailing

[Numpy-discussion] unique return_index order?

2014-03-21 Thread Alan G Isaac
? Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] [RFC] should we argue for a matrix power operator, @@?

2014-03-16 Thread Alan G Isaac
with having to use npla.matrix_power(M,n) instead of M@@n in other teaching settings (e.g., graph theory and recurrence relations). I am certainly not objecting to making `@@` available. It just seems much less important than getting `@` asap. Thanks, Alan Isaac __

Re: [Numpy-discussion] [RFC] should we argue for a matrix power operator, @@?

2014-03-15 Thread Alan G Isaac
@`. Questions for `@@`: - would it just be `matrix_power`, with all the restrictions? - or would `a(10,2,2)@@-1` return an array of matrix inverses? - etc In the end, I'd like to see a functional implementation before deciding on `@@`, but I would not like to see `@` d

Re: [Numpy-discussion] Matrix multiplication infix operator PEP nearly ready to go

2014-03-12 Thread Alan G Isaac
Cheers, Alan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] invert bincounts?

2014-02-27 Thread Alan G Isaac
I have a bincount array `cts`. I'd like to produce any one array `a` such that `cts==np.bincounts(a)`. Easy to do in a loop, but does NumPy offer a better (i.e., faster) way? Thanks, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discu

[Numpy-discussion] shortcut nonzero?

2014-02-25 Thread Alan G Isaac
not have a `first=k` option. Is such an option worth suggesting? Thanks, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] numpy.random.geometric is shifted

2014-02-25 Thread Alan G Isaac
Just got momentarily snagged by not checking the excellent documentation, which clearly says that numpy provides the shifted geometric. I'm wondering why? Who else does? (Not Mathematica, Matlab, Maple, or Octave.) Thanks, Alan Isaac ___

[Numpy-discussion] flatnonzero fails with lists

2014-02-24 Thread Alan G Isaac
just asking, is this intentional? (version 1.7.1) Thanks, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] How exactly ought 'dot' to work?

2014-02-24 Thread Alan G Isaac
g for clarification.) To be concrete, if `@` is proposed to behave unlike Mathematica's `Dot` command, I would hope to hear a very clear mathematical motivation for this. (Specifically, I do not understand why `@` would do scalar product.) Otoh, if the proposal is just that `@` should behav

Re: [Numpy-discussion] How exactly ought 'dot' to work?

2014-02-22 Thread Alan G Isaac
new matrix multiplication operator would not handle scalar multiplication or violate tensor product rules (perhaps I am influenced by Mathematica), but I am not prepared to argue the principles of such choices, and would appreciate hearing from those who are. Thanks, Alan Isaac

Re: [Numpy-discussion] Proposal to make power return float, and other such things.

2014-02-17 Thread Alan G Isaac
On 2/17/2014 8:13 PM, Charles R Harris wrote: > This is apropos issue #899 <https://github.com/numpy/numpy/issues/899>, where > it is suggested that power promote integers to float. Even when base and exponent are both positive integers

Re: [Numpy-discussion] deprecate numpy.matrix

2014-02-11 Thread Alan G Isaac
e it already knows how to be seen as an ndarray, the library can always work with m.A when doing any linear algebra. From what I've read in this thread, the real issues for scipy seem to lie with the sparse matrix objects... ? Alan ___ NumPy-Discus

Re: [Numpy-discussion] deprecate numpy.matrix

2014-02-10 Thread Alan G Isaac
ted, and a matrix object already knows how (e.g., m.A). Presumably in this scenario __asarray__ would return an object that behaves like an ndarray and a converter for turning the final result into the desired object type (e.g., into a `matrix` if necessary). Hope that clearer, even if it prove

Re: [Numpy-discussion] deprecate numpy.matrix

2014-02-10 Thread Alan G Isaac
ntee the core semantics? (And the matrix object passes this test.) For some objects we can agree that `asarray` will coerce them. (E.g., lists.) I just do not see why scipy should care about the semantics an object uses for interacting with other objects of the same type. Alan Isaac _

  1   2   3   4   5   6   7   8   9   10   >