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.
No
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:
http://old.n
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's
On Wed, Feb 8, 2012 at 6:49 AM, Travis Oliphant 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 arrays: i =
> ar
On Feb 8, 2012, at 4:19 PM, Robert Kern wrote:
> On Wed, Feb 8, 2012 at 22:11, Travis Oliphant 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 wrote:
On 08.02.2012 15:49, Travis Oliphant wrote:
> This s
On Wed, Feb 8, 2012 at 22:11, Travis Oliphant 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 wrote:
>>> On 08.02.2012 15:49, Travis Oliphant wrote:
>>>
This sort of thing would take time, but is not out of the question
On Feb 8, 2012, at 11:17 AM, josef.p...@gmail.com wrote:
> On Wed, Feb 8, 2012 at 10:29 AM, Sturla Molden 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
On Wed, Feb 8, 2012 at 8:49 AM, Travis Oliphant 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 using th
On Wed, Feb 8, 2012 at 10:18 AM, Debashish Saha 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 good idea to use tha
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
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
On Wed, Feb 8, 2012 at 10:29 AM, Sturla Molden 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 think I us
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
The problem is that hstack needs a tuple as argument:
x = ones( (9,1) )
y = zeros( (9,2) )
z = hstack( (x,y) )
Notice the parenthesis in the arguments.
Paulo
De: Stephanie Cooke
Para: numpy-discussion@scipy.org
Enviadas: Quarta-feira, 8 de Fevereiro de 2012
You
On Wed, Feb 8, 2012 at 4:32 PM, Stephanie Cooke
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 matrix
> (called mat
On Wed, Feb 8, 2012 at 11:32 AM, Stephanie Cooke
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 matrix
> (called matrix)
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
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
lac
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 instanc
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 pro
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)" w
Le 8 février 2012 00:01, Travis Oliphant 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 lo
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 t
2012/2/8 Stéfan van der Walt :
> On Tue, Feb 7, 2012 at 2:03 PM, Travis Oliphant 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:
>
> http://pages.github.com/
On Tue, Feb 7, 2012 at 9:01 PM, Travis Oliphant 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, a2)
ind1.shape ==
25 matches
Mail list logo