Re: [Numpy-discussion] Inversion of near singular matrices.

2011-01-29 Thread Stuart Brorson
So my question is: how can one reliably detect singularity (or near singularity) and raise an exception? Matrix condition number: http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.cond.html http://en.wikipedia.org/wiki/Condition_number Stuart

Re: [Numpy-discussion] Change of behavior in flatten between 1.0.4 and 1.1

2008-07-02 Thread Stuart Brorson
On Tue, 1 Jul 2008, Pauli Virtanen wrote: Tue, 01 Jul 2008 17:18:55 -0400, Stuart Brorson wrote: I have noticed a change in the behavior of numpy.flatten(True) between NumPy 1.0.4 and NumPy 1.1. The change affects 3D arrays. I am wondering if this is a bug or a feature. [...] To me

[Numpy-discussion] Change of behavior in flatten between 1.0.4 and 1.1

2008-07-01 Thread Stuart Brorson
]) In [5]: A.flatten(True) Out[5]: array([ 1, 5, 9, 3, 7, 11, 2, 6, 10, 4, 8, 12]) Note that the output of A.flatten(True) is different. Is this a bug or a feature? Cheers, Stuart Brorson Interactive Supercomputing, inc. 135 Beaver Street | Waltham | MA | 02452 | USA http

[Numpy-discussion] numpy.sign(numpy.nan)?????

2008-05-16 Thread Stuart Brorson
solicit the opinions of other folks in the NumPy community about the proper behavior of numpy.sign(numpy.nan). Cheers, Stuart Brorson Interactive Supercomputing, inc. 135 Beaver Street | Waltham | MA | 02452 | USA http://www.interactivesupercomputing.com

Re: [Numpy-discussion] Handling of numpy.power(0, something)

2008-02-28 Thread Stuart Brorson
** 0^0: This is problematic. Accessible discussion: URL:http://en.wikipedia.org/wiki/Exponentiation#Zero_to_the_zero_power Thanks. That was quite informative. Indeed, I communicated with a math professor at MIT who also more or less convinced me that 0^0 = 1. Stuart

Re: [Numpy-discussion] Handling of numpy.power(0, something)

2008-02-28 Thread Stuart Brorson
, -1) Traceback (most recent call last): File stdin, line 1, in module ValueError: math domain error Why isn't this one inf? Also, what do these specs say about 0^complex? Cheers, Stuart Brorson Interactive Supercomputing, inc. 135 Beaver Street | Waltham | MA | 02452 | USA http

[Numpy-discussion] Handling of numpy.power(0, something)

2008-02-27 Thread Stuart Brorson
1. + 1.i A .^ B ans = Inf 1. NaN +NaNi Any reactions to this? Does NumPy just make library calls when computing power, or does it do any trapping of corner cases? And should the returns from power conform to the above suggestions? Regards, Stuart Brorson

Re: [Numpy-discussion] round, fix, ceil, and floor for complex args

2008-02-04 Thread Stuart Brorson
and Im parts. Or am I wrong? Cheers, Stuart Brorson Interactive Supercomputing, inc. 135 Beaver Street | Waltham | MA | 02452 | USA http://www.interactivesupercomputing.com/ [1] Sorry for whining, by the way! I'm just poking at the boundaries of NumPy's feature envelope and trying to see how self

[Numpy-discussion] round, fix, ceil, and floor for complex args

2008-02-04 Thread Stuart Brorson
implement round for complex args, then you need to also support ceil, floor, and fix for complex args, so it's a bug. But I thought I'd ask the developers what they thought before filing a ticket. Regards, Stuart Brorson Interactive Supercomputing, inc. 135 Beaver Street | Waltham | MA | 02452 | USA http

Re: [Numpy-discussion] difference numpy/matlab

2008-01-29 Thread Stuart Brorson
to do a greater-than or less-than type operation involving complex numbers. This would force the user to explicitly take the magnitude or the real imaginary part of his number before doing any comparisons, thereby eliminating any confusion due to ambiguity. Just my $0.02. Cheers, Stuart Brorson

[Numpy-discussion] numpy.concatenate doesn't check axis for 1D case. Bug or feature?

2008-01-24 Thread Stuart Brorson
array is a different question, and I am agnostic about that one. Cheers, Stuart Brorson Interactive Supercomputing, inc. 135 Beaver Street | Waltham | MA | 02452 | USA http://www.interactivesupercomputing.com/ ___ Numpy-discussion mailing list Numpy

Re: [Numpy-discussion] changed behavior of numpy.histogram

2008-01-23 Thread Stuart Brorson
-monotonically increasing bins can lead to confusing or inexplicable results. On the other hand, I would support the idea of a new function numpy.countunique() as you suggest. Just my two cents... Stuart Brorson Interactive Supercomputing, inc. 135 Beaver Street | Waltham | MA | 02452 | USA http

Re: [Numpy-discussion] changed behavior of numpy.histogram

2008-01-23 Thread Stuart Brorson
. Cheers, Stuart Brorson Interactive Supercomputing, inc. 135 Beaver Street | Waltham | MA | 02452 | USA http://www.interactivesupercomputing.com/ On Wed, 23 Jan 2008, Mark.Miller wrote: Greetings: I just noticed a changed behavior of numpy.histogram. I think that a recent 'fix' to the code has

Re: [Numpy-discussion] Nasty bug using pre-initialized arrays

2008-01-05 Thread Stuart Brorson
math, after all! Stuart Brorson Interactive Supercomputing, inc. 135 Beaver Street | Waltham | MA | 02452 | USA http://www.interactivesupercomputing.com/ ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman

Re: [Numpy-discussion] Nasty bug using pre-initialized arrays

2008-01-04 Thread Stuart Brorson
On Fri, 4 Jan 2008, Stuart Brorson wrote: I just discovered this today. It looks like a bug to me. Please flame me mercilessly if I am wrong! :-) FWIW, here's what Matlab does: A = rand(1, 4) + rand(1, 4)*i A = Columns 1 through 3 0.7833 + 0.7942i 0.6808 + 0.0592i 0.4611

Re: [Numpy-discussion] Nasty bug using pre-initialized arrays

2008-01-04 Thread Stuart Brorson
variables is to barf -- throw an exception. At least that's what I would expect. Comments? Stuart Brorson Interactive Supercomputing, inc. 135 Beaver Street | Waltham | MA | 02452 | USA http://www.interactivesupercomputing.com/ --- session log - In [77

[Numpy-discussion] Nasty bug using pre-initialized arrays

2008-01-04 Thread Stuart Brorson
into the tracking system. By the way, this is NumPy 1.0.4: In [39]: numpy.__version__ Out[39]: '1.0.4' Cheers, Stuart Brorson Interactive Supercomputing, inc. 135 Beaver Street | Waltham | MA | 02452 | USA http://www.interactivesupercomputing.com/ -- session log

Re: [Numpy-discussion] pre-initialized arrays

2008-01-04 Thread Stuart Brorson
take a long time if your matrices are large. Cheers, Stuart Brorson Interactive Supercomputing, inc. 135 Beaver Street | Waltham | MA | 02452 | USA http://www.interactivesupercomputing.com/ ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http

Re: [Numpy-discussion] Nasty bug using pre-initialized arrays

2008-01-04 Thread Stuart Brorson
from array elements to array elements) I can see if I can figure out how to fix it then submit a patch. But I won't promise anything! My brain hurts already after analyzing this feature. :-) Cheers, Stuart Brorson Interactive Supercomputing, inc. 135 Beaver Street | Waltham | MA | 02452

Re: [Numpy-discussion] how do I list all combinations

2007-12-26 Thread Stuart Brorson
)] Cheers, Stuart Brorson Interactive Supercomputing, inc. 135 Beaver Street | Waltham | MA | 02452 | USA http://www.interactivesupercomputing.com/ ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo

[Numpy-discussion] Compiler change for Windows version between 1.0.3.1 and 1.0.4?

2007-12-19 Thread Stuart Brorson
the old P3 chip couldn't handle. Can the developers confirm or deny my hypothesis? Thanks, Stuart Brorson Interactive Supercomputing, inc. 135 Beaver Street | Waltham | MA | 02452 | USA http://www.interactivesupercomputing.com/ ___ Numpy-discussion mailing

[Numpy-discussion] histogram using decending range -- what do the results mean?

2007-10-05 Thread Stuart Brorson
Guys -- I'm a little puzzled by a NumPy behavior. Perhaps the gurus on this list can enlighten me, please! I am working with numpy.histogram. I have a decent understanding of how it works when given an ascending range to bin into. However, when I give it a *decending* range, I can't figure

Re: [Numpy-discussion] histogram using decending range -- what do the results mean?

2007-10-05 Thread Stuart Brorson
Robert, Thanks for your answers about histogram's meaning for range=(7, 0)! * If it truely isn't meaningful, why not catch the case and reject input? Maybe this is a bug ??? Patches are welcome. OK. I don't know if you have a patch tracking system, so I'll just post it here. If you

Re: [Numpy-discussion] histogram using decending range -- what do the results mean?

2007-10-05 Thread Stuart Brorson
OK. I don't know if you have a patch tracking system, so I'll just post it here. If you have a patch tracker, point me to it and I'll enter the patch there. http://projects.scipy.org/scipy/numpy OK, entered as ticket #586. Cheers, Stuart ___

Re: [Numpy-discussion] Question about numpy.max(complex matrix)

2007-09-21 Thread Stuart Brorson
Thank you for your answer! As a NumPy newbie, I am still learning things about NumPy which I didn't expect. Today I learned that for a matrix of complex numbers, numpy.max() returns the element with the largest *real* part, not the element with the largest *magnitude*. There isn't a

Re: [Numpy-discussion] Question about numpy.max(complex matrix)

2007-09-21 Thread Stuart Brorson
On Fri, 21 Sep 2007, Robert Kern wrote: Stuart Brorson wrote: Is it NumPy's goal to be as compatible with Matlab as possible? No. OK, so that's fair enough. But how about self-consistency? I was thinking about this issue as I was biking home this evening. To review my question

Re: [Numpy-discussion] Question about numpy.max(complex matrix)

2007-09-21 Thread Stuart Brorson
Is it NumPy's goal to be as compatible with Matlab as possible? No. OK, so that's fair enough. But how about self-consistency? I was thinking about this issue as I was biking home this evening. To review my question: a array([[ 1. +1.j , 1. +2.j ], [ 2. +1.j , 1.9+1.9j]])

Re: [Numpy-discussion] Question about numpy.max(complex matrix)

2007-09-21 Thread Stuart Brorson
No. It is a matter of sorting first on the real part, and then resolving duplicates by sorting on the imaginary part. The magnitude is not used: [snip] Oh, OK. So the ordering algorithm for complex numbers is: 1. First sort on real part. 2. Then sort on imag part. Right? Stuart

Re: [Numpy-discussion] Question about numpy.max(complex matrix)

2007-09-21 Thread Stuart Brorson
On Fri, 21 Sep 2007, David Goldsmith wrote: Not to be snide, but I found this thread very entertaining, as, precisely because there is no single, well-defined (partial) ordering of C, I regard it as poor coding practice to rely on whatever partial ordering the language you're using may (IMO