Re: [Numpy-discussion] matrix multiply

2008-04-06 Thread Alan G Isaac
On Sun, 6 Apr 2008, Charles R Harris wrote: The boolean algebra is a field and the correct addition is xor, which is the same as addition modulo 2. This makes all matrices with determinant 1 invertible. This isn't the current convention, however, as it was when Caratheodory was writing on

Re: [Numpy-discussion] matrix multiply

2008-04-06 Thread Alan G Isaac
On Sun, 6 Apr 2008, Anne Archibald apparently wrote: I am not aware of any algorithm for finding inverses, or even determining which matrices are invertible, in the peculiar Boolean arithmetic we use. Again, it is *not* peculiar, it is very standard for boolean matrices. And with this

Re: [Numpy-discussion] matrix multiply

2008-04-06 Thread Alan G Isaac
On Sun, 6 Apr 2008, Charles R Harris apparently wrote: I prefer the modern usage myself as it is closer to the accepted logic operations, but applying algebraic manipulations like powers and matrix inverses in that context leads to strange results. I have not really thought much about

Re: [Numpy-discussion] matrix multiply

2008-04-06 Thread Alan G Isaac
On Sun, 6 Apr 2008, Charles R Harris apparently wrote: You mean as edges in a directed graph? Yes. Naturally a boolean matrix is not the most compact representation of a directed graph, especially a sparse one. However it can be convenient. If B is a boolean matrix such that Bij=1 if there

Re: [Numpy-discussion] Simple financial functions for NumPy

2008-04-04 Thread Alan G Isaac
On Fri, 4 Apr 2008, Gael Varoquaux apparently wrote: I really thing numpy should be as thin as possible, so that you can really say that it is only an array manipulation package. This will also make it easier to sell as a core package for developpers who do not care about calculator

Re: [Numpy-discussion] newbie doubt about dot()

2008-04-01 Thread Alan G Isaac
On Tue, 1 Apr 2008, harryos apparently wrote: i need to calculate wk=uk o (L-Psi) where uk=a vector of size (1 X N^2) o =scalar product l,Psi=vectors of (N^2 X 1) i have an ndarray U of shape(M X N^2)where uk is one of the rows , and L of shape (M X N^2) where l.transpose() is one of

Re: [Numpy-discussion] greedy loadtxt

2008-03-27 Thread Alan G Isaac
On Thu, 27 Mar 2008, lorenzo bolla apparently wrote: I realized that numpy.loadtxt do not read the last character of an input file. This is annoying if the input file do not end with a newline. I believe Robert fixed this; update from the SVN repository. hth, Alan Isaac

Re: [Numpy-discussion] accumarray

2008-03-26 Thread Alan G Isaac
On Wed, Mar 26, 2008 at 5:20 PM, Gabriel J.L. Beckers [EMAIL PROTECTED] wrote: Does numpy have something like Matlab's accumarray? http://www.mathworks.com/access/helpdesk/help/techdoc/ref/accumarray.html On Wed, 26 Mar 2008, Robert Kern apparently wrote: No. But of course you can do

Re: [Numpy-discussion] matrices in 1.1

2008-03-22 Thread Alan G Isaac
On Sat, 22 Mar 2008, Stéfan van der Walt apparently wrote: maybe you can post a link as a reminder URL:http://projects.scipy.org/pipermail/numpy-discussion/2008-February/031548.html In the matrix world, everything has a minimum dimension of 2, so I don't see how you can contain ndarrays in

Re: [Numpy-discussion] matrices in 1.1

2008-03-21 Thread Alan G Isaac
On Fri, 21 Mar 2008, Nadav Horesh apparently wrote: I would like to see a unification of matrices and arrays. I often do calculation which involve both array processing and linear algebra, and the current solution of having function like dot and inv is not aesthetic. Switching between

Re: [Numpy-discussion] matrices in 1.1

2008-03-21 Thread Alan G Isaac
On Fri, 21 Mar 2008, Stéfan van der Walt apparently wrote: The last I remember, we considered adding RowVector, ColumnVector and letting slices out of a matrix either be one of those or a matrix itself. There was a subsequent discussion. I simply don't see a Matrix as a container of

Re: [Numpy-discussion] matrices in 1.1

2008-03-21 Thread Alan G Isaac
On Sat, 22 Mar 2008, Nadav Horesh apparently wrote: A*v ... ValueError: objects are not aligned This is just how I want matrices to act! If A is m׳n, then v should be n׳1 for A*v to be defined. Anything else is trouble waiting to happen. But it seems that Charles's proposal would make

Re: [Numpy-discussion] new question - summing a list of arrays

2008-03-18 Thread Alan G Isaac
On Tue, 18 Mar 2008, Chris Withers apparently wrote: Say I have an aribtary number of arrays: arrays = [array([1,2,3]),array([4,5,6]),array([7,8,9])] How can I sum these all together? Try N.sum(arrays,axis=0). But must they be in a list? An array of arrays (i.e., 2d array) is easy to sum.

Re: [Numpy-discussion] newbie question - summing a list of arrays

2008-03-18 Thread Alan G Isaac
On Tue, 18 Mar 2008, Chris Withers apparently wrote: Where are the docs for sum? Again: http://www.scipy.org/Numpy_Example_List_With_Doc Really, as a new NumPy user you should just keep this page open in your browser. Also, help(N.sum), of course. Cheers, Alan Isaac

Re: [Numpy-discussion] how to build a series of arrays as I go?

2008-03-17 Thread Alan G Isaac
On Mon, 17 Mar 2008, Chris Withers apparently wrote: woefully inadequate state of the currently available free documentation 1. http://www.scipy.org/Numpy_Example_List_With_Doc 2. write some Cheers, Alan Isaac ___ Numpy-discussion mailing list

Re: [Numpy-discussion] how to build a series of arrays as I go?

2008-03-17 Thread Alan G Isaac
Alan suggested: 1. http://www.scipy.org/Numpy_Example_List_With_Doc On Mon, 17 Mar 2008, Chris Withers apparently wrote: Yeah, read that, wood, trees, can't tell the... Oh, then you might want http://www.scipy.org/Tentative_NumPy_Tutorial or the other stuff at

Re: [Numpy-discussion] Transforming an array of numbers to an array of formatted strings

2008-03-13 Thread Alan G Isaac
On Thu, 13 Mar 2008, Alexander Michael apparently wrote: I want to format an array of numbers as strings. To what end? Note that tofile has a format option. And for 1d array ``x`` you can always do:: strdata = list( fmt%xi for xi in x) Nice because the counter name does not bleed into

Re: [Numpy-discussion] Transforming an array of numbers to an array of formatted strings

2008-03-13 Thread Alan G Isaac
2008/3/13, Alan G Isaac [EMAIL PROTECTED]: strdata = list( fmt%xi for xi in x) Nice because the counter name does not bleed into your program. On Thu, 13 Mar 2008, David Huard apparently wrote: ['S%03d'%i for i in int_data] The difference is that the counter bleeds from the list

[Numpy-discussion] fromiter + dtype='S' - Python crash

2008-03-13 Thread Alan G Isaac
On Thu, 13 Mar 2008, Alexander Michael apparently wrote: I wasn't sure if there was a magic numpy method to do the loop quickly (as the destination array is created beforehand) without creating a temporary Python list, but I guess not. The generator/list-comprehension is likely better than

Re: [Numpy-discussion] fromfunction() bug?

2008-03-13 Thread Alan G Isaac
This is how I would hope ``fromfunction`` would work and it matches the docs. (See below.) You can fix the example ... Cheers, Alan Isaac help(N.fromfunction) Help on function fromfunction in module numpy.core.numeric: fromfunction(function, shape, **kwargs) Returns an array constructed

Re: [Numpy-discussion] preparing to tag NumPy 1.0.5 on Wednesday

2008-03-04 Thread Alan G Isaac
Alan G Isaac wrote: I never got a response to this: URL:http://projects.scipy.org/pipermail/scipy-dev/2008-February/008424.html (Two different types claim to be numpy.int32.) On Mon, 03 Mar 2008, Travis E. Oliphant apparently wrote: It's not a bug :-) There are two c-level types

Re: [Numpy-discussion] loadtxt broken if file does not end in newline

2008-02-27 Thread Alan G Isaac
On Wed, 27 Feb 2008, Robert Kern apparently wrote: Fixed in r4827. On Wed, Feb 27, 2008 at 6:31 PM, Christopher Barker wrote: For the record, this is the fixed version: comment_start = line.find(comments) if comment_start 0: line =

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

2008-02-27 Thread Alan G Isaac
On Wed, 27 Feb 2008, Stuart Brorson apparently wrote: ** 0^0: This is problematic. Accessible discussion: URL:http://en.wikipedia.org/wiki/Exponentiation#Zero_to_the_zero_power Cheers, Alan Isaac ___ Numpy-discussion mailing list

Re: [Numpy-discussion] matrix wart

2008-02-22 Thread Alan G Isaac
On Thu, Feb 21, 2008 at 12:08:32PM -0500, Alan G Isaac wrote: a matrix behavior that I find bothersome and unnatural:: M = N.mat('1 2;3 4') M[0] matrix([[1, 2]]) M[0][0] matrix([[1, 2]]) On Fri, 22 Feb 2008, Stefan van der Walt apparently wrote: Could you

Re: [Numpy-discussion] matrix wart

2008-02-22 Thread Alan G Isaac
On Fri, 22 Feb 2008, Travis E. Oliphant apparently wrote: The point is that a matrix object is a matrix object and not a generic container. I see the point a bit differently: there are costs and benefits to the abandonment of a specific and natural behavior of containers. (The kind of

Re: [Numpy-discussion] matrix wart

2008-02-22 Thread Alan G Isaac
On Fri, 22 Feb 2008, Travis E. Oliphant apparently wrote: Do I understand correctly, that by intuitive you mean based on experience with lists, and NumPy arrays? Yes. In particular, array behavior is quite lovely and almost never surprising, so matrices should deviate from it only when there

Re: [Numpy-discussion] matrix wart

2008-02-22 Thread Alan G Isaac
Alan G Isaac wrote: I propose that the user-friendly question is: why deviate needlessly from array behavior? (Needlessly means: no increase in functionality.) On Fri, 22 Feb 2008, Christopher Barker apparently wrote: because that's the whole point of a Matrix object in the first place

Re: [Numpy-discussion] Matching 0-d arrays and NumPy scalars

2008-02-21 Thread Alan G Isaac
On Thu, 21 Feb 2008, Konrad Hinsen apparently wrote: What I see as more fundamental is the behaviour of Python container objects (lists, sets, etc.). If you add an object to a container and then access it as an element of the container, you get the original object (or something that

Re: [Numpy-discussion] Matching 0-d arrays and NumPy scalars

2008-02-21 Thread Alan G Isaac
On Thu, 21 Feb 2008, Konrad Hinsen apparently wrote: A float64 array is thus a container of float64 values. Well ... ok:: x = N.array([1,2],dtype='float') x0 = x[0] type(x0) type 'numpy.float64' So a float64 value is whatever a numpy.float64 is, and that is part of

Re: [Numpy-discussion] matrix wart

2008-02-21 Thread Alan G Isaac
On Thu, Feb 21, 2008 at 12:08:32PM -0500, Alan G Isaac wrote: a matrix behavior that I find bothersome and unnatural:: M = N.mat('1 2;3 4') M[0] matrix([[1, 2]]) M[0][0] matrix([[1, 2]]) On Fri, 22 Feb 2008, Stefan van der Walt apparently wrote: This is exactly

Re: [Numpy-discussion] bug in numpy.histogram?

2008-02-20 Thread Alan G Isaac
On Wed, 20 Feb 2008, John Hunter apparently wrote: File /home/titan/johnh/dev/lib/python2.4/site-packages/numpy/lib/function_base.py, line 155, in histogram if(any(bins[1:]-bins[:-1] 0)): NameError: global name 'any' is not defined ``any`` was introduced in Python 2.5, so you

Re: [Numpy-discussion] import issue with new Python

2008-02-15 Thread Alan G Isaac
On Fri, 15 Feb 2008, Dinesh B Vadhia apparently wrote: I upgraded to Python 2.5.2c1 today, and got the following error for: import numpy import scipy Traceback (most recent call last): File C:\ ... .py, line 19, in module import scipy ImportError: No module named scipy I'm using

Re: [Numpy-discussion] searchsorted bug

2008-01-31 Thread Alan G Isaac
Problem also with Windows P3 binaries. fwiw, Alan Isaac Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. import numpy numpy.__version__ '1.0.4' A = numpy.array(['a','aa','b']) B =

Re: [Numpy-discussion] matrix - ndarray bug

2008-01-31 Thread Alan G Isaac
On Thu, 31 Jan 2008, dmitrey apparently wrote: already fixed in more recent versions? Yes, at least it's fixed in my 1.0.4. By the way, do you know about the ``A`` attribute of matrices? Cheers, Alan Isaac ___ Numpy-discussion mailing list

Re: [Numpy-discussion] pre-initialized arrays

2008-01-04 Thread Alan G Isaac
On Fri, 4 Jan 2008, Stuart Brorson apparently wrote: I realize NumPy != Matlab, but I'd wager that most users would think that this is the natural behavior. I would not find it natural that elements of my float array could be assigned complex values. How could it be a fixed chunk of memory

Re: [Numpy-discussion] unexpected behavior with allclose( scalar, empty array)

2008-01-03 Thread Alan G Isaac
On Thu, 3 Jan 2008, Charles R Harris apparently wrote: Isn't it trivially true that all elements of an empty array are close to any number? Sure, but might not one expect a ValueError due to shape mismatch? (Doesn't allclose usually use normal broadcasting rules?) Cheers, Alan Isaac

Re: [Numpy-discussion] unexpected behavior with allclose( scalar, empty array)

2008-01-03 Thread Alan G Isaac
On Thu, 3 Jan 2008, Charles R Harris apparently wrote: Isn't it trivially true that all elements of an empty array are close to any number? On Thu, 3 Jan 2008, Alan G Isaac apparently wrote: Sure, but might not one expect a ValueError due to shape mismatch? (Doesn't allclose usually use

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

2007-12-30 Thread Alan G Isaac
On Wed, 26 Dec 2007, Mathew Yeates apparently wrote: r1=[dog,cat] r2=[1,2] I want to return [[dog,1],[dog,2],[cat,1],[cat,2]] This is a Cartesian product. Sage has ``cartesian_product_iterator`` for this. Also

Re: [Numpy-discussion] numpy installed but can' use

2007-12-29 Thread Alan G Isaac
On Sat, 29 Dec 2007, dikshie apparently wrote: so import numpy and from numpy import * are different ? http://docs.python.org/tut/node8.html hth, Alan Isaac ___ Numpy-discussion mailing list Numpy-discussion@scipy.org

Re: [Numpy-discussion] new P3 binaries for NumPy 1.0.4 and SciPy 0.6.0

2007-12-21 Thread Alan G Isaac
On Thu, 20 Dec 2007, Jarrod Millman apparently wrote: If you are having problems with NumPy and SciPy on Pentium III machines running Windows, please try the newly released binaries: I used the Python 2.5 binaries (.exe) on my home P3 and all seems well in use. I got no failures of

Re: [Numpy-discussion] [SciPy-user] maskedarray

2007-12-12 Thread Alan G Isaac
On Wed, 12 Dec 2007, Travis E. Oliphant apparently wrote: 2) The matrix object made a C-subclass (for speed). This will probably be the last chance for such a change, so I again hope that consideration will be given to *one* change in the matrix object: iteration over a matrix should return

Re: [Numpy-discussion] Changing the distributed binary for numpy 1.0.4 for windows ?

2007-12-10 Thread Alan G Isaac
This may be a naive question, but just to be sure... If troubles building without SSE2 support on an SSE2 processor are the problem, withould the problem be addressed by purchasing an old PIII like

Re: [Numpy-discussion] multinomial question

2007-12-06 Thread Alan G Isaac
Alan G Isaac wrote: I would think that multinomial(1,prob,size=ntrials).sum(axis=0) would be equivalent to multinomial(ntrials,prob) but the first gives a surprising result. (See below.) Explanation? On Wed, 05 Dec 2007, Robert Kern apparently wrote: Pretty much anyone who

[Numpy-discussion] multinomial question

2007-12-05 Thread Alan G Isaac
I would think that multinomial(1,prob,size=ntrials).sum(axis=0) would be equivalent to multinomial(ntrials,prob) but the first gives a surprising result. (See below.) Explanation? Thank you, Alan Isaac ntrials = 10 prob = N.arange(100,dtype=N.float32)/4950

Re: [Numpy-discussion] loadtxt bug?

2007-11-23 Thread Alan G Isaac
On Fri, Nov 23, 2007 at 07:58:13AM -0500, Alan G Isaac wrote: Specifically, is it not the case that the last line of a text file is not guaranteed to have a terminator? Does this not raise the possibility that a digit will be clipped from the last line? On Fri, 23 Nov 2007, Gael

Re: [Numpy-discussion] loadtxt bug?

2007-11-23 Thread Alan G Isaac
On Thu, Nov 22, 2007 at 11:14:07PM -0500, Alan G Isaac wrote: In numpy.core.numeric.py you will find loadtxt, which uses the following:: line = line[:line.find(comments)].strip() On Fri, 23 Nov 2007, Gael Varoquaux apparently wrote: Unless you are sure that line always ends

[Numpy-discussion] loadtxt bug?

2007-11-22 Thread Alan G Isaac
In numpy.core.numeric.py you will find loadtxt, which uses the following:: line = line[:line.find(comments)].strip() I believe there is a bug here (when a line has no comment). To illustrate:: line = 12345 comments = # line[:line.find(comments)] '1234' So I propose

Re: [Numpy-discussion] weibull distribution has only one parameter?

2007-11-12 Thread Alan G Isaac
On Mon, 12 Nov 2007, D.Hendriks (Dennis) apparently wrote: All of this makes me doubt the correctness of the formula you proposed. It is always a good idea to hesitate before doubting Robert.

[Numpy-discussion] matrix problem: float to matrix power

2007-10-30 Thread Alan G Isaac
1.0**numpy.array([1,2,3]) array([ 1., 1., 1.]) 1.0**numpy.mat([1,2,3]) Traceback (most recent call last): File stdin, line 1, in module TypeError: unsupported operand type(s) for ** or pow(): 'float' and 'matrix' Why the restriction for matrices? Same question for matrices conformable for

Re: [Numpy-discussion] design patterns for computing

2007-10-17 Thread Alan G Isaac
It sounds to me like you have something closer to the following. class Problem - initialized with an Input instance and an Analysis instance - has a ``get_results`` method that asks the Analysis instance to - call ``get_input`` on Input instance - run analysis on the provided

Re: [Numpy-discussion] Use of PyArray FromAny() wi th a PyArrayInterface object

2007-10-12 Thread Alan G Isaac
On Fri, 12 Oct 2007, Matthieu Brucher apparently wrote: I'm trying to understand (but perhaps everything is in the numpy book in which case I'd rather buy the book immediately) how to use the PyArray_FromAny() function. This function is discussed in the NumPy Book. I see perhaps a dozen

Re: [Numpy-discussion] abstraction and interfaces

2007-10-12 Thread Alan G Isaac
On Fri, 12 Oct 2007, Renato Serodio apparently wrote: The scripts that produce these metrics use Scipy/Numpy functions that operate on data conveniently converted to numpy arrays. They're quite specific, and I tend to produce/tweak a lot of them. So, to fit in this application someone

Re: [Numpy-discussion] numpy.distutils.cpuinfo bugs?

2007-10-11 Thread Alan G Isaac
On Tue, 2 Oct 2007, David M. Cooke apparently wrote: Should be fixed now. The update seems to work for all my students who were having problems. Thank you, Alan Isaac ___ Numpy-discussion mailing list Numpy-discussion@scipy.org

Re: [Numpy-discussion] beginner question: rank-1 arrays

2007-10-08 Thread Alan G Isaac
On Mon, 8 Oct 2007, Robin apparently wrote: However in my code (I am converting from MATLAB) it is important to maintain 2d arrays, and keep the difference between row and column vectors. How about using matrices? help(numpy.mat) hth, Alan Isaac

Re: [Numpy-discussion] Python Magazine

2007-10-07 Thread Alan G Isaac
On Fri, 05 Oct 2007, Christopher Barker apparently wrote: There is a new Python Magazine out there: http://www.pythonmagazine.com/ Looks useful. If you think so too, make sure you library subscribes. Cheers, Alan Isaac ___ Numpy-discussion

Re: [Numpy-discussion] Default value in documentation

2007-10-04 Thread Alan G Isaac
On Tue, 2 Oct 2007, Charles R Harris apparently wrote: We're avoiding consolidated fields because they behave badly. ... The main problem with the consolidated fields is that they are all put together as item lists in a definition list and moved to the end of the docstring when it is

[Numpy-discussion] boolean matrix bug?

2007-10-03 Thread Alan G Isaac
Shouldn't x**0 be boolean for a boolean matrix? Cheers, Alan Isaac import numpy numpy.__version__ '1.0.3.1' x = numpy.mat('1 1;1 0',dtype='bool') x**0 matrix([[ 1., 0.], [ 0., 1.]]) x**1 matrix([[ True, True], [ True, False]], dtype=bool) x**2 matrix([[ True, True],

Re: [Numpy-discussion] [SciPy-dev] adopting Python Style Guide for classes

2007-10-03 Thread Alan G Isaac
To help me understand, might someone offer some examples of NumPy names that really should be changed? Thank you, Alan Isaac ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] numpy.distutils.cpuinfo bugs?

2007-10-02 Thread Alan G Isaac
On Tue, 02 Oct 2007, Pearu Peterson apparently wrote: 1. The printed '0' traces to an undesirable print statement. (I've reported this before.) Travis seemed to fix this about two weeks ago. Sorry for the noise. 2. The 'False report is on a Pentium M. Should that not be True?

Re: [Numpy-discussion] numpy.distutils.cpuinfo bugs?

2007-10-02 Thread Alan G Isaac
Here is the processor information using the Intel utility. Cheers, Alan Isaac Intel(R) Processor Identification Utility Version: 3.7.20070907 Time Stamp: 2007/10/02 14:21:29 Number of processors in system: 1 Current processor: #1 Cores per processor: 1 Disabled cores per processor: 0 Processor

Re: [Numpy-discussion] Default value in documentation

2007-10-02 Thread Alan G Isaac
On Tue, 2 Oct 2007, Pierre GM apparently wrote: is there any kind of standard to describe the attributes of a class, a la :IVariables: in epydoc ? I thought it was ... :IVariables: i.e., I thought the standard was reST as handled by epydoc.

Re: [Numpy-discussion] combinations anomaly

2007-09-22 Thread Alan G Isaac
On Sat, 22 Sep 2007, Charles R Harris apparently wrote: an array view is returned, and the data is updated in the loop ... I think your range fix is the way to go. Got it. Thanks! Alan ___ Numpy-discussion mailing list Numpy-discussion@scipy.org

Re: [Numpy-discussion] Extracting all the possible com binations of a grid

2007-09-21 Thread Alan G Isaac
On Fri, 21 Sep 2007, Stephen McInerney apparently wrote: The pure Pythonic solution is a list comprehension involving multiple sequences: x = range(0,n) y = x z = x t = [(xx,yy,zz) for xx in x for yy in y for zz in z] Different question ... Cheers, Alan Isaac

[Numpy-discussion] unwanted cpuinfo output

2007-09-19 Thread Alan G Isaac
Suppose I import cpuinfo on a Win32 platform:: Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. import numpy numpy.__version__ '1.0.3.1' from numpy.distutils import

Re: [Numpy-discussion] Citing Numeric and numpy

2007-08-29 Thread Alan G Isaac
On Wed, 29 Aug 2007, Peter apparently wrote: I would like to know if there is a preferred form for citing the old Numeric library I'll attach text from the first two pages of *Numerical Python* below. Cheers, Alan Isaac - An Open

Re: [Numpy-discussion] additional thanks

2007-08-24 Thread Alan G Isaac
On Fri, 24 Aug 2007, Ryan Krauss apparently wrote: I helped a couple of my students install on Vista. It was enough to right click on the exe and choose Run as Administrator. A pop-up window then comes up asking you if you trust the file or something and you have to chose an option that

Re: [Numpy-discussion] numpy.array does not take generators

2007-08-16 Thread Alan G Isaac
On Thu, 16 Aug 2007, Geoffrey Zhu apparently wrote: K=numpy.array(o[2]/1000.0 for o in opts) It does not work. K=numpy.fromiter((o[2]/1000.0 for o in opts),'float') hth, Alan Isaac ___ Numpy-discussion mailing list Numpy-discussion@scipy.org

Re: [Numpy-discussion] Count the occurrence of a certain integer in a list of integers

2007-08-07 Thread Alan G Isaac
On Tue, 07 Aug 2007, Nils Wagner apparently wrote: I have a list of integer numbers. The entries can vary between 0 and 19. How can I count the occurrence of any number. Consider data [9, 6, 9, 6, 7, 9, 9, 10, 7, 9, 9, 6, 7, 9, 8, 8, 11, 9, 6, 7, 10, 9, 7, 9, 7, 8, 9, 8, 7, 9] Is there

Re: [Numpy-discussion] multinomial error?

2007-08-05 Thread Alan G Isaac
On Fri, 03 Aug 2007, [EMAIL PROTECTED] apparently wrote: I appear to be having a problem with the random.multinomial function. For some reason if i attempt to loop over a large number of single-trial multinomial picks then the function begins to ignore some non-zero entries in my 1-D

Re: [Numpy-discussion] Finalising documentation guidelines for NumPy

2007-07-17 Thread Alan G Isaac
On Tue, 17 Jul 2007, Stefan van der Walt apparently wrote: var1 : Description. breaks. This can be fixed either by omitting the colon after 'var1' in the second case, or by slightly modifying epydoc's output. It breaks semantically too, no? (The colon is a separator,

Re: [Numpy-discussion] Should bool_ subclass int?

2007-07-10 Thread Alan G Isaac
I found Gael's presentation rather puzzling for two reasons. 1. It appears to contain a `+` vs. `*` confusion. See http://en.wikipedia.org/wiki/Two-element_Boolean_algebra 2. MUCH more importantly: In implementations of TWO, we interpret `-` as unary complementation (not e.g. as additive

Re: [Numpy-discussion] Should bool_ subclass int?

2007-07-10 Thread Alan G Isaac
On Mon, 9 Jul 2007, Timothy Hochberg apparently wrote: x*y and x**2 are already decoupled for arrays and matrices. What if x*y was simply defined to do a boolean matrix multiply when the arguments are boolean matrices? I don't care about this that much though, so I'll let it drop. So if

Re: [Numpy-discussion] Should bool_ subclass int?

2007-07-10 Thread Alan G Isaac
Hi Gael, More important is the following. On Tue, 10 Jul 2007, Alan G Isaac apparently wrote: N.array([False])-N.array([True]) array([True], dtype=bool) N.array([False])+(-N.array([True])) array([False], dtype=bool) The second answer is the right one, in this context. I would call

Re: [Numpy-discussion] [SciPy-dev] numpy.cumproduct() documentation: bug?

2007-07-04 Thread Alan G Isaac
On Wed, 04 Jul 2007, dmitrey apparently wrote: cumproduct(x, axis=None, dtype=None, out=None) Sum the array over the given axis. Docstring bug. But it behaves right. Cheers, Alan Isaac ___ Numpy-discussion mailing list

Re: [Numpy-discussion] Unfortunate user experience with max()

2007-05-16 Thread Alan G Isaac
On Wed, 16 May 2007, Anne Archibald apparently wrote: numpy.max(-1.3,2,7) -1.3 Is that new behavior? I get a TypeError on the last argument. (As expected.) Cheers, Alan Isaac ___ Numpy-discussion mailing list Numpy-discussion@scipy.org

Re: [Numpy-discussion] Documentation

2007-05-15 Thread Alan G Isaac
Gary Ruben wrote: In you post, is your numpy/doc reference referring to the file HOWTO_DOCUMENT.txt? I notice that this is not the same as the one here http://scipy.org/DocstringStandard which I think may be the preferred standard. If someone can confirm this, it should probably

Re: [Numpy-discussion] Documentation

2007-05-15 Thread Alan G Isaac
On 5/15/07, Alan G Isaac [EMAIL PROTECTED] wrote: Just to add a bit more specificity, I believe that the HOWTO_DOCUMENT.txt document at http://svn.scipy.org/svn/numpy/trunk/numpy/doc/HOWTO_DOCUMENT.txt summarizes a substantial discussion and broad agreement. I.e., it is currently

Re: [Numpy-discussion] Documentation

2007-05-15 Thread Alan G Isaac
On Tue, 15 May 2007, Charles R Harris apparently wrote: It also causes the headings to be set in large bold type. Ugly. Well I agree. But again this is just a style issue. All font decisions (and *much* else) can be set in a CSS file. I think reST is great, and properly used we get good

Re: [Numpy-discussion] Documentation

2007-05-15 Thread Alan G Isaac
On Tue, May 15, 2007 at 01:15:12PM -0400, Alan G Isaac wrote: Bullets in consolidated lists: if you don't like them, don't use them. Use a definition list instead. (I like this much better myself.) On Tue, 15 May 2007, Gael Varoquaux apparently wrote: Can't this be fixed

Re: [Numpy-discussion] Documentation

2007-05-15 Thread Alan G Isaac
On Tue, 15 May 2007, Charles R Harris apparently wrote: If a CSS can set all the font styles, item spacing, and treatment of explanatory text, that would be the more flexible route. I'm not sure what treatment meams here, but if it is a matter of font decisions or spacing, the answer should

Re: [Numpy-discussion] Documentation

2007-05-15 Thread Alan G Isaac
On Tue, 15 May 2007, Charles R Harris apparently wrote: Looks like the font used for section headings can be specified, but there is nothing in the epydoc.css file that looks like it affects the consolidated lists or the movement of a section heading to the top of the output. I think the

Re: [Numpy-discussion] Documentation

2007-05-15 Thread Alan G Isaac
On Tue, 15 May 2007, Charles R Harris apparently wrote: The item in a consolidated list is divided into three parts: name, type, explanation. I see no way in the CSS to control the display of those parts, although it might be an undocumented feature. I basically want it to look like a

Re: [Numpy-discussion] Documentation

2007-05-15 Thread Alan G Isaac
On Tue, 15 May 2007, Charles R Harris apparently wrote: What I would like it to look like, except for the type stuff, is attached. Ooof! Aside from obviously agreeing with the location of notes and examples, I have to say, the readability of your example is greatly reduced from the epydoc

Re: [Numpy-discussion] building pynetcdf-0.7 on OS X 10.4 intel

2007-05-02 Thread Alan G Isaac
On Wed, 02 May 2007, Rob De Almeida apparently wrote: http://cheeseshop.python.org/pypi/pupynere/ I do not think you were shameless enough. Pupynere is a PUre PYthon NEtcdf REader. It allows read-access to netCDF files using the same syntax as the

Re: [Numpy-discussion] question about standalone small software and teaching

2007-04-05 Thread Alan G Isaac
On Thu, 5 Apr 2007, Gael Varoquaux apparently wrote: Actually I do it the other way around nowadays. Except in the tutorial? But anyway, I'm willing to try anything that gets them moving. It is true that avoiding the appearance of complexity can sometimes add complexity. Cheers, Alan Isaac

Re: [Numpy-discussion] basic python questions

2007-04-04 Thread Alan G Isaac
On Wed, 04 Apr 2007, Eric Firing apparently wrote: Key point: properties work with new-style classes but fail silently and mysteriously with classic classes. Or making the same point a little more generally, descriptors only work for new-style classes:

[Numpy-discussion] organizational question

2007-03-30 Thread Alan G Isaac
Is either NumPy or SciPy substantially supported by an identifiable and actual non-profit organization? I ask because I think both fit under http://www.mellon.org/grant_programs/programs/copy_of_research item 4. Here is the announcement: http://matc.mellon.org/ Note that universities are among

Re: [Numpy-discussion] matrix indexing question

2007-03-29 Thread Alan G Isaac
On Tue, 27 Mar 2007, Zachary Pincus apparently wrote: Now, Bill offers up a different suggestion: indexing M yields neither a matrix nor an array, but a class that operates more or less like an array, except insofar as it interacts with other matrix objects, or other objects of similar

Re: [Numpy-discussion] matrix indexing question

2007-03-27 Thread Alan G Isaac
On Tue, 27 Mar 2007, Bill Baxter apparently wrote: xformedPt = someComplicatedNonLinearThing(pt) I do stuff like the above quite frequently in my code, although with arrays rather than matrices. Exactly: that was one other thing I found artificial. Surely the points will then be wanted as

Re: [Numpy-discussion] missing use case

2007-03-27 Thread Alan G Isaac
Hi Zachary, I think your response highlights very well the apparent design flaw. Here is your response to my request for a use case where iteration over a matrix should yield matrices: do not iterate! Does some part of you not find that just a little bizarre?! As for offering as a use

Re: [Numpy-discussion] matrix indexing question

2007-03-27 Thread Alan G Isaac
Hi Zach, The use case I requested was for iteration over a matrix where it is desirable that matrices are yielded. That is not what you offered. The context for this request is my own experience: whenever I have needed to iterate over matrices, I have always wanted the arrays. So I am simply

Re: [Numpy-discussion] matrix indexing question

2007-03-27 Thread Alan G Isaac
On Tue, 27 Mar 2007, Robert Kern apparently wrote: Gram-Schmidt orthogonalization I take it from context that you consider it desirable to end up with a list of matrices? I guess I would find it more natural to work with the arrays, but perhaps that starts just being taste. Thank you, Alan

Re: [Numpy-discussion] matrix indexing question

2007-03-27 Thread Alan G Isaac
On Tue, 27 Mar 2007, Robert Kern apparently wrote: Gram-Schmidt orthogonalization Alan G Isaac wrote: I take it from context that you consider it desirable to end up with a list of matrices? Robert wrote: Honestly, I don't care. You asked about iteration, and I gave you

Re: [Numpy-discussion] matrix indexing question

2007-03-26 Thread Alan G Isaac
On Mon, 26 Mar 2007, Colin J. Williams apparently wrote: Perhaps things would be clearer if we thought of the constituent groups of data in a matrix as being themselves matrices. This thinking of is what you have suggested before. You need to explain why it is not begging the question.

Re: [Numpy-discussion] matrix indexing question

2007-03-26 Thread Alan G Isaac
Alan G Isaac schrieb: X[1] array([3,4]) X[1,:] matrix([[3, 4]]) But again the point is: indexing for submatrices should produce matrices. Normal Python indexing should access the constituent arrays. On Mon, 26 Mar 2007, Sven Schreiber apparently wrote: I think

Re: [Numpy-discussion] matrix indexing question

2007-03-26 Thread Alan G Isaac
Alan G Isaac schrieb: What feels wrong: iterating over a container does not give access to the contained objects. This is not Pythonic. On Mon, 26 Mar 2007, Sven Schreiber apparently wrote: If you iterate over the rows of the matrix, it feels natural to me to get the row vectors

Re: [Numpy-discussion] matrix indexing question

2007-03-26 Thread Alan G Isaac
On Mon, 26 Mar 2007, Sebastian Haase apparently wrote: A matrix is an object that you expect a certain (mathematical !) behavior from. If some object behaves intuitively right -- that's ultimately pythonic! The problem is, as I am not the only one to point out, this particular behavior is

Re: [Numpy-discussion] matrix indexing question

2007-03-26 Thread Alan G Isaac
On Mon, 26 Mar 2007, Colin J. Williams apparently wrote: One would expect the iteration over A to return row vectors, represented by (1, n) matrices. On 3/26/07, Alan G Isaac [EMAIL PROTECTED] wrote: This is again simple assertion. **Why** would one expect this? Some people clearly

[Numpy-discussion] matrix indexing question

2007-03-25 Thread Alan G Isaac
One thing keeps bugging me when I use numpy.matrix. All this is fine:: x=N.mat('1 1;1 0') x matrix([[1, 1], [1, 0]]) x[1,:] matrix([[1, 0]]) But it seems to me that I should be able to extract a matrix row as an array. So this :: x[1] matrix([[1,

Re: [Numpy-discussion] matrix indexing question

2007-03-25 Thread Alan G Isaac
Em Dom, 2007-03-25 às 13:07 -0400, Alan G Isaac escreveu: x[1] matrix([[1, 0]]) feels wrong. (Similarly when iterating across rows.) On Sun, 25 Mar 2007, Paulo Jose da Silva e Silva apparently wrote: I think the point here is that if you are using matrices, then all you should

<    1   2   3   4   5   6   7   >