On Fri, Apr 6, 2012 at 12:19 AM, Travis Oliphant wrote:
>
> On Apr 6, 2012, at 1:01 AM, Charles R Harris wrote:
>
>
>
> On Thu, Apr 5, 2012 at 11:57 PM, Travis Oliphant wrote:
>
>> As of 1.5.1 this worked:
>>
>> >>> numpy.__version__
>> 1.5.1
>> >>> numpy.uint64(5) & 3
>> 1L
>>
>>
>> So, this is a
>
> Although 1.5.1 also gives
>
> >>> np.uint(3) + 4
> 7.0
>
> i.e., a float, which certainly doesn't look right either. Whereas
>
> >>> np.int(3) + 4
> 7
>
> The float promotion is still there in 1.6.1
>
> In [4]: uint64(1) + 2
> Out[4]: 3.0
>
> So I suppose there is the larger question is
On Fri, Apr 6, 2012 at 12:01 AM, Charles R Harris wrote:
>
>
> On Thu, Apr 5, 2012 at 11:57 PM, Travis Oliphant wrote:
>
>> As of 1.5.1 this worked:
>>
>> >>> numpy.__version__
>> 1.5.1
>> >>> numpy.uint64(5) & 3
>> 1L
>>
>>
>> So, this is a regression and a bug. It should be fixed so that it
>
On Apr 6, 2012, at 1:01 AM, Charles R Harris wrote:
>
>
> On Thu, Apr 5, 2012 at 11:57 PM, Travis Oliphant wrote:
> As of 1.5.1 this worked:
>
> >>> numpy.__version__
> 1.5.1
> >>> numpy.uint64(5) & 3
> 1L
>
>
> So, this is a regression and a bug. It should be fixed so that it doesn't
>
On Thu, Apr 5, 2012 at 11:57 PM, Travis Oliphant wrote:
> As of 1.5.1 this worked:
>
> >>> numpy.__version__
> 1.5.1
> >>> numpy.uint64(5) & 3
> 1L
>
>
> So, this is a regression and a bug. It should be fixed so that it
> doesn't raise an error. I believe the scalars were special cased so that
As of 1.5.1 this worked:
>>> numpy.__version__
1.5.1
>>> numpy.uint64(5) & 3
1L
So, this is a regression and a bug. It should be fixed so that it doesn't
raise an error. I believe the scalars were special cased so that a raw 3 would
not be interpreted as a signed int when it is clearly uns
On Thu, Apr 5, 2012 at 11:39 PM, Charles R Harris wrote:
>
>
> On Thu, Apr 5, 2012 at 11:16 PM, Travis Oliphant wrote:
>
>> Which version of NumPy are you using. This could be an artefact of the
>> new casting rules.
>>
>> This used to work. So, yes, this is definitely a bug.
>>
>>
> It's beca
On Thu, Apr 5, 2012 at 11:16 PM, Travis Oliphant wrote:
> Which version of NumPy are you using. This could be an artefact of the
> new casting rules.
>
> This used to work. So, yes, this is definitely a bug.
>
>
It's because the '3' is treated as signed, so the uint64 needs to be cast
to someth
Which version of NumPy are you using. This could be an artefact of the new
casting rules.
This used to work. So, yes, this is definitely a bug.
-Travis
On Apr 5, 2012, at 10:54 PM, Chris Laumann wrote:
> Hi all-
>
> I've been trying to use numpy arrays of ints as arrays of bit fields
The only slicing short-cut I can think of is the Ellipsis object, but it's
not going to help you much here.
The alternatives that come to my mind are (1) manipulation of shape
directly and (2) building a string and running eval on it.
Your solution is better than (1), and (2) is a horrible hack, so
Hi all-
I've been trying to use numpy arrays of ints as arrays of bit fields and mostly
this works fine. However, it seems that the bitwise_* ufuncs do not support
unsigned integer dtypes:
In [142]: np.uint64(5)&3
---
Type
dear all,
I've routinely found that:
1) ndarray.take is up to 1 order of magnitude faster than fancy indexing
2) Hand-coded Cython boolean indexing is many times faster than ndarray indexing
3) putmask is significantly faster than ndarray indexing
For example, I stumbled on this tonight:
strai
06.04.2012 00:57, Whitcomb, Mr. Tim kirjoitti:
[clip]
> Did something go wrong with a build?
Seems so. As a workaround, you can read the documentation of the
released versions.
--
Pauli Virtanen
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy
Good afternoon - we're having some issues here accessing the online
documentation for the latest NumPy version:
1. Search for "numpy asarray" on Google
2. Top result is "numpy.asarray - NumPy v1.7.dev-72185d3 Manual (DRAFT)"
(or just go directly to link)
3. Click link - arrive at
http://docs.sci
On Thu, Apr 05, 2012 at 01:05:01PM -0700, Abhishek Pratap wrote:
> Also in my case I dont really have a good approximate on value of K in
> K-means.
That's a hard problem, for which I have no answer, sorry :$
G
___
NumPy-Discussion mailing list
NumPy-D
Also in my case I dont really have a good approximate on value of K in K-means.
-A
On Thu, Apr 5, 2012 at 8:06 AM, Abhishek Pratap wrote:
> Hi Gael
>
> The MemoryError exception I am getting is from using scikit's DBSCAN
> implementation. I can check mini-batch implementation of Kmeans.
>
> Best
Is there a way to slice an nd-array along a specified axis? It's easy to
slice along a fixed axis, e.g.:
axis = 0:
>>> array[start:end]
axis = 1:
>>> array[:, start:end]
...
But I need to do this inside of a function that accepts arrays of any
dimension, and the user can operate on any axis of t
Along the lines of my question about apply getitem to each element...
If I try to use nditer, I seem to run into trouble:
for d in np.nditer (y, ['refs_ok'],['readwrite']):
: y[...].w = 2
:
---
AttributeEr
Le 5 avril 2012 12:50, Neal Becker a écrit :
> Ken Watford wrote:
>
> > On Thu, Apr 5, 2012 at 11:57 AM, Olivier Delalleau
> wrote:
> >> Le 5 avril 2012 11:45, Neal Becker a écrit :
> >>
> >> You can do:
> >>
> >> f = numpy.frompyfunc(lambda x: x.some_attribute == 0, 1, 1)
> >>
> >> Then
> >> f
Sorry for the noise on the ML, I thougt I had made a private reply...
--
Pierre
Le 05/04/2012 18:53, Pierre Haessig a écrit :
> Hi Chao,
>
> Le 05/04/2012 17:17, Chao YUE a écrit :
>> nice to know this. can also use b.transpose().flatten() to circumvent it.
> Just a short remark : b.T is a shorc
Hi Chao,
Le 05/04/2012 17:17, Chao YUE a écrit :
> nice to know this. can also use b.transpose().flatten() to circumvent it.
Just a short remark : b.T is a shorcut for b.transpose() ;-)
Best,
Pierre
signature.asc
Description: OpenPGP digital signature
_
Ken Watford wrote:
> On Thu, Apr 5, 2012 at 11:57 AM, Olivier Delalleau wrote:
>> Le 5 avril 2012 11:45, Neal Becker a écrit :
>>
>> You can do:
>>
>> f = numpy.frompyfunc(lambda x: x.some_attribute == 0, 1, 1)
>>
>> Then
>> f(array_of_objects_x)
>
> This is handy too:
>
> agetattr = numpy.fro
On Thu, Apr 5, 2012 at 11:57 AM, Olivier Delalleau wrote:
> Le 5 avril 2012 11:45, Neal Becker a écrit :
>
> You can do:
>
> f = numpy.frompyfunc(lambda x: x.some_attribute == 0, 1, 1)
>
> Then
> f(array_of_objects_x)
This is handy too:
agetattr = numpy.frompyfunc(getattr, 2, 1)
array_of_value
Le 5 avril 2012 11:45, Neal Becker a écrit :
> Adam Hughes wrote:
>
> > If you are storing objects, then can't you store them in a list and just
> do:
> >
> > for obj in objectlist:
> > obj.attribute = value
> >
> > Or am I misunderstanding?
> >
>
> It's multi-dimensional, and I wanted to av
Adam Hughes wrote:
> If you are storing objects, then can't you store them in a list and just do:
>
> for obj in objectlist:
> obj.attribute = value
>
> Or am I misunderstanding?
>
It's multi-dimensional, and I wanted to avoid writing explicit loops.
_
If you are storing objects, then can't you store them in a list and just do:
for obj in objectlist:
obj.attribute = value
Or am I misunderstanding?
On Thu, Apr 5, 2012 at 11:31 AM, Neal Becker wrote:
> I have an array of object.
>
> How can I apply attribute access to each element?
>
> I
I have an array of object.
How can I apply attribute access to each element?
I want to do, for example,
np.all (u.some_attribute == 0) for all elements in u?
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/li
nice to know this. can also use b.transpose().flatten() to circumvent it.
thanks,
Chao
2012/4/5 Pierre Haessig
> Hi,
>
> Le 05/04/2012 15:00, Olivier Delalleau a écrit :
> > Ok, it looks weird indeed. I was using numpy 1.6.1 myself, not sure if
> > it's a bug that's been fixed in 1.6.
> > Try
Hi Gael
The MemoryError exception I am getting is from using scikit's DBSCAN
implementation. I can check mini-batch implementation of Kmeans.
Best,
-Abhi
On Wed, Apr 4, 2012 at 10:33 PM, Gael Varoquaux
wrote:
> On Wed, Apr 04, 2012 at 04:41:51PM -0700, Abhishek Pratap wrote:
>> Thanks Chris. So
Hi,
Le 05/04/2012 15:00, Olivier Delalleau a écrit :
> Ok, it looks weird indeed. I was using numpy 1.6.1 myself, not sure if
> it's a bug that's been fixed in 1.6.
> Try without the keyword argument (b.flatten('C')), see if at least
> that works.
I can reproduce Chao's bug with my numpy 1.5.
As
Ok, it looks weird indeed. I was using numpy 1.6.1 myself, not sure if it's
a bug that's been fixed in 1.6.
Try without the keyword argument (b.flatten('C')), see if at least that
works.
-=- Olivier
Le 5 avril 2012 08:12, Chao YUE a écrit :
> Hi,
>
> I use 1.51.
> In [69]: np.__version__
> Out[
Hi,
I use 1.51.
In [69]: np.__version__
Out[69]: '1.5.1'
the help information seems OK.
In [70]: b.flatten?
Type:builtin_function_or_method
Base Class:
String Form:
Namespace:Interactive
Docstring:
a.flatten(order='C')
Return a copy of the array collapsed into one di
It works for me, which version of numpy are you using?
What do you get when you type help(b.flatten)?
-=- Olivier
Le 5 avril 2012 04:45, Chao YUE a écrit :
> Dear all,
>
> Is there a small bug in following?
>
> In [2]: b
> Out[2]:
> array([[ 0, 1, 2, 3, 4, 5],
>[ 6, 7, 8, 9, 10,
Dear all,
Is there a small bug in following?
In [2]: b
Out[2]:
array([[ 0, 1, 2, 3, 4, 5],
[ 6, 7, 8, 9, 10, 11],
[12, 13, 14, 15, 16, 17],
[18, 19, 20, 21, 22, 23]])
In [3]: b.flatten(order='C')
-
34 matches
Mail list logo