On Mon, Jan 19, 2009 at 7:34 PM, Hans Meine
me...@informatik.uni-hamburg.de wrote:
On Friday 19 December 2008 03:27:12 Bradford Cross wrote:
This is a new project I just released.
I know it is C#, but some of the design and idioms would be nice in
numpy/scipy for working with discrete event
Hi all,
what is the best way to check if the entries (integers)
of an array are stored in ascending order ?
Nils
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Nils Wagner wrote:
Hi all,
what is the best way to check if the entries (integers)
of an array are stored in ascending order ?
Hi Nils,
Try np.alltrue( ar[1:] ar[:-1] ).
r.
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
On Thu, 22 Jan 2009 11:23:43 +0100
Robert Cimrman cimrm...@ntc.zcu.cz wrote:
Nils Wagner wrote:
Hi all,
what is the best way to check if the entries (integers)
of an array are stored in ascending order ?
Hi Nils,
Try np.alltrue( ar[1:] ar[:-1] ).
r.
Thank you !
Nils
Hi all,
Is it possible to add a header option for savetxt ?
Nils
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Hello,
I have a test script:
import numpy as np
class MyArray(np.ndarray):
__array_priority__ = 20
def __new__(cls):
return np.asarray(1).view(cls).copy()
def __repr__(self):
return 'my_array'
__str__ = __repr__
def __mul__(self, other):
return
Darren,
The type returned by np.array is ndarray, unless I specifically set
subok=True, in which case I get a MyArray. The default value of
subok is True, so I dont understand why I have to specify subok
unless I want it to be False. Is my subclass missing something
important?
Rich,
Basic python only supports double precision floats, so that is not an option.
NumPy does not have, as far as I know, a way to set the default precision,
although it might be a reasonable request.
As for the SWIG interface file, almost anything is possible. Can you give an
example of a
Interesting.
The tests pass on my machine
OS X,
Python version 2.5.4 (r254:67916, Dec 29 2008, 17:02:44) [GCC 4.0.1
(Apple Inc. build 5488)]
nose version 0.10.4
For
File
/home/nwagner/local/lib64/python2.6/site-packages/numpy/lib/tests/
test_recfunctions.py,
line 34, in test_zip_descr
On Thu, 22 Jan 2009 12:53:39 -0500
Pierre GM pgmdevl...@gmail.com wrote:
Interesting.
The tests pass on my machine
OS X,
Python version 2.5.4 (r254:67916, Dec 29 2008, 17:02:44)
[GCC 4.0.1
(Apple Inc. build 5488)]
nose version 0.10.4
For
File
On Jan 22, 2009, at 1:31 PM, Nils Wagner wrote:
Hi Pierre,
Thank you. Works for me.
You're welcome, thanks for reporting!
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Hi,
I have to debug a matlab program -- is there a way to do a post
mortem debugging ?
(I don't even know if this term even exists outside of python ;-)
((I want to know some local variable values and find out why our
program crashes when there are no particles found...))
Thanks,
Sebastian Haase
Did you say matlab ? ;-)
I have to debug a matlab program -- is there a way to do a post
mortem debugging ?
(I don't even know if this term even exists outside of python ;-)
((I want to know some local variable values and find out why our
program crashes when there are no particles
import cProfile
def f():
pass
def g():
for i in xrange(100):
f()
cProfile.run(g())
test.py
103 function calls in 1.225 CPU seconds
Ordered by: standard name
ncalls tottime percall cumtime percall filename:lineno(function)
10.0000.000
On Thu, Jan 22, 2009 at 17:00, Wes McKinney wesmck...@gmail.com wrote:
import cProfile
def f():
pass
def g():
for i in xrange(100):
f()
cProfile.run(g())
test.py
103 function calls in 1.225 CPU seconds
Ordered by: standard name
ncalls tottime
Windows XP, Pentium D, Python 2.5.2
On Thu, Jan 22, 2009 at 6:03 PM, Robert Kern robert.k...@gmail.com wrote:
On Thu, Jan 22, 2009 at 17:00, Wes McKinney wesmck...@gmail.com wrote:
import cProfile
def f():
pass
def g():
for i in xrange(100):
f()
Hi All
I want to get out the index of values in an array. Normally WHERE
works fine for one conditional statement but it does not work for two
- i.e.
a = array([0,1,2,3,4,5,6,7,8,9])
ind, = where(a 5)
Works fine but if I wanted:
ind = where((a 5) and (a8))
Then it bugs out with the
Ross Williamson wrote:
Hi All
I want to get out the index of values in an array. Normally WHERE
works fine for one conditional statement but it does not work for two
- i.e.
a = array([0,1,2,3,4,5,6,7,8,9])
ind, = where(a 5)
Works fine but if I wanted:
ind = where((a 5) and
Hi, I just noticed that the N-D array interface page is outdated and
doesn't mention the buffer interface that is standard with Python 2.6
and Python 3.0:
http://numpy.scipy.org/array_interface.shtml
This page is linked to from http://numpy.scipy.org/
I suggest, at the minimum, modifying the
2009/1/22 Pierre GM pgmdevl...@gmail.com:
Darren,
The type returned by np.array is ndarray, unless I specifically set
subok=True, in which case I get a MyArray. The default value of
subok is True, so I dont understand why I have to specify subok
unless I want it to be False. Is my subclass
Hello,
In an effort to suppress for loops, I have arrived to the following situation.
Through vectorial logical operations I generate a set of indices for which
the contents of an array have to be incremented. My problem can be reduced
to the following:
#This works
import numpy
Hi,
#This does not work
import numpy
a=numpy.zeros(10)
b=numpy.ones(4, numpy.int)
a[b] += 1
The problem here is that you are setting a[1] to a[1]+1.
I think you want:
import numpy
a=numpy.zeros(10)
b=numpy.ones(4, numpy.bool)
a[b] += 1
Best,
Matthew
On Fri, Jan 23, 2009 at 01:39, Matthew Brett matthew.br...@gmail.com wrote:
Hi,
#This does not work
import numpy
a=numpy.zeros(10)
b=numpy.ones(4, numpy.int)
a[b] += 1
The problem here is that you are setting a[1] to a[1]+1.
I think you want:
import numpy
a=numpy.zeros(10)
On Fri, Jan 23, 2009 at 01:11, V. Armando Sole s...@esrf.fr wrote:
Hello,
In an effort to suppress for loops, I have arrived to the following situation.
Through vectorial logical operations I generate a set of indices for which
the contents of an array have to be incremented. My problem can
Judging from his for loop, he does want the integer array. He's doing
something like histogramming.
Yup, thanks, just goes to show that it's not good to send emails after
a glass of wine late at night with slight jetlag.
Matthew
___
Numpy-discussion
25 matches
Mail list logo