Re: [Numpy-discussion] Logical indexing and higher-dimensional arrays.

2012-02-08 Thread Stéfan van der Walt
On Tue, Feb 7, 2012 at 9:01 PM, Travis Oliphant tra...@continuum.io wrote: like so:  x[ind1, :, ind2], the question is what should the shape of the output me.   If ind1 is a scalar there is no ambiguity (and this should be special cased --- but unfortunately isn't). If x.shape == (a0, a1,

Re: [Numpy-discussion] Download page still points to SVN

2012-02-08 Thread Scott Sinclair
2012/2/8 Stéfan van der Walt ste...@sun.ac.za: On Tue, Feb 7, 2012 at 2:03 PM, Travis Oliphant tra...@continuum.io wrote: John Turner at ORNL has the numpy.org domain and perhaps we could get him to point it to numpy.github.com Remember to also put a CNAME file in the root of the repository:

Re: [Numpy-discussion] Download page still points to SVN

2012-02-08 Thread Pauli Virtanen
Hi, 08.02.2012 11:22, Scott Sinclair kirjoitti: [clip] I see that you've added the CNAME file. Now numpy.github.com is being redirected to numpy.scipy.org (the old site). As I understand it, whoever controls the scipy.org DNS settings needs point numpy.scipy.org at numpy.github.com so that

Re: [Numpy-discussion] Logical indexing and higher-dimensional arrays.

2012-02-08 Thread Olivier Delalleau
Le 8 février 2012 00:01, Travis Oliphant tra...@continuum.io a écrit : On Feb 7, 2012, at 12:24 PM, Sturla Molden wrote: On 07.02.2012 19:17, Benjamin Root wrote: print x.shape (2, 3, 4) print x[0, :, :].shape (3, 4) print x[0, :, idx].shape (2, 3) That looks like a bug to

Re: [Numpy-discussion] Logical indexing and higher-dimensional arrays.

2012-02-08 Thread Sturla Molden
On 08.02.2012 06:01, Travis Oliphant wrote: Recall that the shape of the output with fancy indexing is determined by broadcasting together the indexing objects and using that as the shape of the output: x[ind1, ind2] will produce an output with the shape of broadcast(ind1, ind2) whose

Re: [Numpy-discussion] Logical indexing and higher-dimensional arrays.

2012-02-08 Thread Travis Oliphant
On Feb 8, 2012, at 8:29 AM, Sturla Molden wrote: On 08.02.2012 06:01, Travis Oliphant wrote: Recall that the shape of the output with fancy indexing is determined by broadcasting together the indexing objects and using that as the shape of the output: x[ind1, ind2] will produce an

Re: [Numpy-discussion] Logical indexing and higher-dimensional arrays.

2012-02-08 Thread Sturla Molden
On 08.02.2012 15:11, Olivier Delalleau wrote: From a user perspective, I would definitely prefer cross-product semantics for fancy indexing. In fact, I had never used fancy indexing with more than one array index, so the behavior described in this thread totally baffled me. If for instance x

Re: [Numpy-discussion] Logical indexing and higher-dimensional arrays.

2012-02-08 Thread Sturla Molden
On 08.02.2012 15:49, Travis Oliphant wrote: This sort of thing would take time, but is not out of the question in my mind because I suspect the number of users and use-cases of broadcasted fancy-indexing is small. In Matlab this (misfeature?) is generally used to compensate for the lack of

[Numpy-discussion] hstack

2012-02-08 Thread Stephanie Cooke
Hello, When I try to use the command hstack, I am given the error message TypeError: hstack() takes exactly 1 argument (2 given). I have a 9X1 array (called array) that I would like to concatenate to a 9X2 matrix (called matrix), and I try to do this by typing the command hstack(array,matrix). I

Re: [Numpy-discussion] hstack

2012-02-08 Thread Malcolm Reynolds
You On Wed, Feb 8, 2012 at 4:32 PM, Stephanie Cooke cooke.stepha...@gmail.com wrote: Hello, When I try to use the command hstack, I am given the error message TypeError: hstack() takes exactly 1 argument (2 given). I have a 9X1 array (called array) that I would like to concatenate to a 9X2

[Numpy-discussion] just the date part of a datetime64[s]?

2012-02-08 Thread John Salvatier
Hello, is there a good way to get just the date part of a datetime64? Frequently datetime datatypes have month(), date(), hour(), etc functions that pull out part of the datetime, but I didn't see those mentioned in the datetime64 docs. Casting to a 'D' dtype didn't work as I would have hoped: In

Re: [Numpy-discussion] Logical indexing and higher-dimensional arrays.

2012-02-08 Thread josef . pktd
On Wed, Feb 8, 2012 at 10:29 AM, Sturla Molden stu...@molden.no wrote: On 08.02.2012 15:49, Travis Oliphant wrote: This sort of thing would take time, but is not out of the question in my mind because I suspect the number of users and use-cases of broadcasted fancy-indexing is small. I

[Numpy-discussion] how to insert some specific delay

2012-02-08 Thread Debashish Saha
how to insert some specific delay in python programming using numpy command. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Logical indexing and higher-dimensional arrays.

2012-02-08 Thread Sturla Molden
On 08.02.2012 18:17, josef.p...@gmail.com wrote: I think I use it quite a bit, and I like that the broadcasting in indexing is as flexible as the broadcasting of numpy arrays themselves. x[np.arange(len(x)), np.arange(len(x))] gives the diagonal for example. Personally I would prefer that

Re: [Numpy-discussion] how to insert some specific delay

2012-02-08 Thread Chris Barker
On Wed, Feb 8, 2012 at 10:18 AM, Debashish Saha silid...@gmail.com wrote: how to insert some specific delay in python programming using numpy command. do you mean a time delay? If so -- numpy doesn't (and shouldn't) have such a thing. however, the time module has time.sleep() whether it's a

Re: [Numpy-discussion] Logical indexing and higher-dimensional arrays.

2012-02-08 Thread Aronne Merrelli
On Wed, Feb 8, 2012 at 8:49 AM, Travis Oliphant tra...@continuum.io wrote: On Feb 8, 2012, at 8:29 AM, Sturla Molden wrote: On 08.02.2012 06:01, Travis Oliphant wrote: Recall that the shape of the output with fancy indexing is determined by broadcasting together the indexing objects and

Re: [Numpy-discussion] Logical indexing and higher-dimensional arrays.

2012-02-08 Thread Travis Oliphant
On Feb 8, 2012, at 11:17 AM, josef.p...@gmail.com wrote: On Wed, Feb 8, 2012 at 10:29 AM, Sturla Molden stu...@molden.no wrote: On 08.02.2012 15:49, Travis Oliphant wrote: This sort of thing would take time, but is not out of the question in my mind because I suspect the number of users

Re: [Numpy-discussion] Logical indexing and higher-dimensional arrays.

2012-02-08 Thread Robert Kern
On Wed, Feb 8, 2012 at 22:11, Travis Oliphant tra...@continuum.io wrote: On Feb 8, 2012, at 11:17 AM, josef.p...@gmail.com wrote: On Wed, Feb 8, 2012 at 10:29 AM, Sturla Molden stu...@molden.no wrote: On 08.02.2012 15:49, Travis Oliphant wrote: This sort of thing would take time, but is not

Re: [Numpy-discussion] Logical indexing and higher-dimensional arrays.

2012-02-08 Thread Travis Oliphant
On Feb 8, 2012, at 4:19 PM, Robert Kern wrote: On Wed, Feb 8, 2012 at 22:11, Travis Oliphant tra...@continuum.io wrote: On Feb 8, 2012, at 11:17 AM, josef.p...@gmail.com wrote: On Wed, Feb 8, 2012 at 10:29 AM, Sturla Molden stu...@molden.no wrote: On 08.02.2012 15:49, Travis Oliphant

Re: [Numpy-discussion] Logical indexing and higher-dimensional arrays.

2012-02-08 Thread Stéfan van der Walt
On Wed, Feb 8, 2012 at 6:49 AM, Travis Oliphant tra...@continuum.io wrote: There are also some very nice applications where you can select out of a 3-d volume a depth-surface defined by indexes like so:        arr[ i[:,newaxis], j, depth] where arr is a 3-d array,  i and j are 1-d index

Re: [Numpy-discussion] just the date part of a datetime64[s]?

2012-02-08 Thread Mark Wiebe
Converting between date and datetime requires caution, because it depends on your time zone. Because all datetime64's are internally stored in UTC, simply casting as in your example treats it in UTC. The 'astype' function does not raise an error to tell you that this is problematic, because

[Numpy-discussion] numpy.arange() error?

2012-02-08 Thread teomat
Hi, Am I wrong or the numpy.arange() function is not correct 100%? Try to do this: In [7]: len(np.arange(3.1, 4.9, 0.1)) Out[7]: 18 In [8]: len(np.arange(8.1, 9.9, 0.1)) Out[8]: 19 I would expect the same result for each command. All the best -- View this message in context:

Re: [Numpy-discussion] numpy.arange() error?

2012-02-08 Thread Eric Firing
On 02/08/2012 09:31 PM, teomat wrote: Hi, Am I wrong or the numpy.arange() function is not correct 100%? Try to do this: In [7]: len(np.arange(3.1, 4.9, 0.1)) Out[7]: 18 In [8]: len(np.arange(8.1, 9.9, 0.1)) Out[8]: 19 I would expect the same result for each command. Not after more