I think the distance matrix version below is about as good
as it gets with these basic strategies.
fwiw,
Alan Isaac
def dist(A,B):
rowsA, rowsB = A.shape[0], B.shape[0]
distanceAB = empty( [rowsA,rowsB] , dtype=float)
if rowsA <= rowsB:
temp = empty_like(B)
for i in r
C-API support for numarray is now checked in to NumPy SVN.
With this support you should be able to compile numarray extensions by
changing the include line from numarray/libnumarray.h to numpy/libnumarray.h
You will also need to change the include directories used in compiling
by appending th
Matthieu Perrot wrote:
> hi,
>
> I need to handle strings shaped by a numpy array whose data own to a C
> structure. There is several possible answers to this problem :
> 1) use a numpy array of strings (PyArray_STRING) and so a (char *) object
> in C. It works as is, but you need to define a m
>>> import numpy
>>> numpy.__version__
'0.9.9.2631'
>>> numpy.Int32
Traceback (most recent call last):
File "", line 1, in ?
AttributeError: 'module' object has no attribute 'Int32'
>>>
This was working not so long ago.
Simon.
--
Simon Burton, B.Sc.
Licensed PO Box 8066
ANU Canberra 2601
Au
Hi Simon
On Tue, Jun 20, 2006 at 08:22:30PM +0100, Simon Burton wrote:
>
> >>> import numpy
> >>> numpy.__version__
> '0.9.9.2631'
> >>> numpy.Int32
> Traceback (most recent call last):
> File "", line 1, in ?
> AttributeError: 'module' object has no attribute 'Int32'
> >>>
>
> This was workin
Johannes Loehnert wrote:
>Hi,
>
>
>
>>## Output:
>>numpy.__version__: 0.9.8
>>y: [ 0. 1. 2. 3. 4. 5. 6. 7. 8. 9.]
>>y**2: [ 0. 1. 4. 9. 16. 25. 36. 49. 64. 81.]
>>z: [ 0. 1. 2. 3. 4. 5. 6. 7. 8. 9.]
>>z**2: [ 0.e+00 1.e+00 1.6000e+01
roughness66.gif
Description: GIF image
___
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion
Tim Hochberg wrote:
> Johannes Loehnert wrote:
>
>> Hi,
>>
>>
>>
>>> ## Output:
>>> numpy.__version__: 0.9.8
>>> y: [ 0. 1. 2. 3. 4. 5. 6. 7. 8. 9.]
>>> y**2: [ 0. 1. 4. 9. 16. 25. 36. 49. 64. 81.]
>>> z: [ 0. 1. 2. 3. 4. 5. 6. 7. 8. 9.]
>>> z**2: [ 0.000
Good morning,
I used the Windows installer to install Python 2.4.3 on a late-model
Dell
PC running XP Pro. Then I installed numpy-0.9.8 and scipy-0.4.9, also from
the Windows installers. Now I am trying to build a dll file for a Fortran
77 file and previously-generated (Linux) pyf fi
A Dimarts 20 Juny 2006 18:17, George Christianson va escriure:
> Good morning,
Thank you, but here the sun is about to set ;-)
> I used the Windows installer to install Python 2.4.3 on a late-model
> Dell
> PC running XP Pro. Then I installed numpy-0.9.8 and scipy-0.4.9, also from
> the W
Travis Oliphant schrieb:
> I just updated the array interface page to emphasize we now have version
> 3. NumPy still supports objects that expose (the C-side) of version 2
> of the array interface, though.
>
> The new interface is basically the same except (mostly) for asthetics:
> The diff
Thomas Heller wrote:
> Travis Oliphant schrieb:
>> I just updated the array interface page to emphasize we now have
>> version 3. NumPy still
>
> If current implementations of the array interface use this pointer for
> other things (like keeping a reference to the array object), that's
> fine,
On Tue, 20 Jun 2006 21:05:51 +0200
Thomas Heller <[EMAIL PROTECTED]> wrote:
> Travis Oliphant schrieb:
> > I just updated the array interface page to emphasize we now have version
> > 3. NumPy still supports objects that expose (the C-side) of version 2
> > of the array interface, though.
> >
In the course of trying to speed up matplotlib, I did a little
experiment that may indicate a place where numpy can be sped up: the
creation of a 2-D array from a list of tuples. Using the attached
script, I find that numarray is roughly 5x faster than either numpy or
Numeric:
[EMAIL PROTECT
The numpy example page still has dtype=Float and dtype=Int
all over it. Is there a generic replacement for Float, Int or should
these be changed to something more specific such as int32?
Erin
On 6/20/06, Stefan van der Walt <[EMAIL PROTECTED]> wrote:
> Hi Simon
>
> On Tue, Jun 20, 2006 at 08:22:3
On Tue, Jun 20, 2006 at 09:00:52PM -0400, Erin Sheldon wrote:
> The numpy example page still has dtype=Float and dtype=Int
> all over it. Is there a generic replacement for Float, Int or should
> these be changed to something more specific such as int32?
> Erin
float and int (the Python types) ar
I have a matrix M and a vector (n by 1 matrix) V. I want to form a new
matrix that contains the columns of M for which V > 0.
One way to do that in Octave is M(:, find(V > 0)). How is it done in numpy?
___
Numpy-discussion mailing list
Numpy-discussion
I think that one's on the NumPy for Matlab users, no?
http://www.scipy.org/NumPy_for_Matlab_Users>>> import numpy as num
>>> a = num.arange
(10).reshape(2,5)>>> aarray([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]])>>> v = num.rand(5)>>> varray([ 0.10934855, 0.55719644, 0.7044047 , 0.19250088, 0.9463
OK, I have changed all the examples that used dtype=Float or
dtype=Int to float and int.
Erin
On 6/20/06, David M. Cooke <[EMAIL PROTECTED]> wrote:
> On Tue, Jun 20, 2006 at 09:00:52PM -0400, Erin Sheldon wrote:
> > The numpy example page still has dtype=Float and dtype=Int
> > all over it. Is th
On 6/20/06, Bill Baxter <[EMAIL PROTECTED]> wrote:
> I think that one's on the NumPy for Matlab users, no?
>
> http://www.scipy.org/NumPy_for_Matlab_Users
>
> >>> import numpy as num
> >>> a = num.arange (10).reshape(2,5)
> >>> a
> array([[0, 1, 2, 3, 4],
>[5, 6, 7, 8, 9]])
> >>> v = num.r
On 6/20/06, Bill Baxter <[EMAIL PROTECTED]> wrote:
> I think that one's on the NumPy for Matlab users, no?
>
> http://www.scipy.org/NumPy_for_Matlab_Users
>
> >>> import numpy as num
> >>> a = num.arange (10).reshape(2,5)
> >>> a
> array([[0, 1, 2, 3, 4],
>[5, 6, 7, 8, 9]])
> >>> v = num.r
On 6/21/06, Erin Sheldon <[EMAIL PROTECTED]> wrote:
On 6/20/06, Bill Baxter <[EMAIL PROTECTED]> wrote:> I think that one's on the NumPy for Matlab users, no?>>
http://www.scipy.org/NumPy_for_Matlab_Users>> >>> import numpy as num> >>> a = num.arange (10).reshape(2,5)> >>> a> array([[0, 1, 2, 3, 4
On Wed, 21 Jun 2006 13:48:48 +0900
"Bill Baxter" <[EMAIL PROTECTED]> wrote:
>
> >>> a[:,num.where(v>0.5)[0]]
> array([[1, 2, 4],
>[6, 7, 9]])
>
> I'll put that up on the Matlab->Numpy page.
oh, yuck. What about this:
>>> a[:,num.nonzero(v>0.5)]
array([[0, 1, 3],
[5, 6, 8]])
>>>
23 matches
Mail list logo