Thanks a lot Robert for this very useful tool!
I was wondering if there is a way to make it work with Cython code (see
below) ?
Sincerely,
Nicolas
fib.pyx:
@profile
def fib(n):
Print the Fibonacci series up to n.
a, b = 0, 1
while b n:
a, b = b, a + b
test.py:
import
Hi,
Is there a good way to perform dot on an arbitrary list of arrays
which avoids using a loop? Here is what I'd like to avoid:
# m1, m2, m3 are arrays
out = np.(m1.shape[0])
prod = [m1, m2, m3, m1, m2, m3, m3, m2]
for m in prod:
... out = np.dot(out, m)
...
I was hoping for something
On Mon, 11 May 2009 10:48:14 -0400
Alan G Isaac ais...@american.edu wrote:
On 5/11/2009 8:36 AM Nils Wagner apparently wrote:
I would like to split strings made of digits after eight
characters each.
[l[i*8:(i+1)*8] for i in range(len(l)/8)]
Alan Isaac
Hello,
I have a file containing mixed data types: strings, floats, datetime
output(i.e. strings), and ints. Something like:
#ID, name, date, value
1,sample,2008-07-10 12:34:20,344.56
And so forth. It seems using recarrays is efficient and a prefered habit to
get into wrg to numpy, so I am
I have a file containing mixed data types: strings, floats, datetime
output(i.e. strings), and ints. Something like:
#ID, name, date, value
1,sample,2008-07-10 12:34:20,344.56
Presuming I get them nicely into a recarray (see my other
On Mon, Jul 20, 2009 at 9:39 AM, Keith Goodman kwgood...@gmail.com wrote:
Using a trick that Robert Kern recently posted to the list makes the
identity function much faster.
Current version:
def identity(n, dtype=None):
a = array([1]+n*[0],dtype=dtype)
b = empty((n,n),dtype=dtype)
On Jul 20, 2009, at 7:54 AM, John [H2O] wrote:
I have a file containing mixed data types: strings, floats, datetime
output(i.e. strings), and ints. Something like:
#ID, name, date, value 1,sample,2008-07-10 12:34:20,344.56
Presuming I get them nicely into a recarray (see my other post)
On Mon, Jul 20, 2009 at 01:42, Nicolas Pintopi...@mit.edu wrote:
Thanks a lot Robert for this very useful tool!
I was wondering if there is a way to make it work with Cython code (see
below) ?
No, line_profiler cannot work with Cython. There is some talk on the
Cython mailing list about
On Mon, Jul 20, 2009 at 9:03 AM, Charles R
Harrischarlesr.har...@gmail.com wrote:
On Mon, Jul 20, 2009 at 9:39 AM, Keith Goodman kwgood...@gmail.com wrote:
Using a trick that Robert Kern recently posted to the list makes the
identity function much faster.
Current version:
def identity(n,
On Mon, Jul 20, 2009 at 05:27, T Jtjhn...@gmail.com wrote:
Hi,
Is there a good way to perform dot on an arbitrary list of arrays
which avoids using a loop? Here is what I'd like to avoid:
# m1, m2, m3 are arrays
out = np.(m1.shape[0])
prod = [m1, m2, m3, m1, m2, m3, m3, m2]
for m in
On Mon, Jul 20, 2009 at 9:32 AM, Keith Goodmankwgood...@gmail.com wrote:
On Mon, Jul 20, 2009 at 9:03 AM, Charles R
Harrischarlesr.har...@gmail.com wrote:
On Mon, Jul 20, 2009 at 9:39 AM, Keith Goodman kwgood...@gmail.com wrote:
Using a trick that Robert Kern recently posted to the list
On 2009-07-20, Keith Goodman kwgood...@gmail.com wrote:
[clip]
Oh, sorry, I misunderstood. Yes, a similar change was made to eye but
not to identity.
Nasty, duplicated code there it seems...
--
Pauli Virtanen
___
NumPy-Discussion mailing list
On Mon, Jul 20, 2009 at 10:53 AM, Pauli Virtanenpav...@iki.fi wrote:
On 2009-07-20, Keith Goodman kwgood...@gmail.com wrote:
[clip]
Oh, sorry, I misunderstood. Yes, a similar change was made to eye but
not to identity.
Nasty, duplicated code there it seems...
So
def myidentity2(n,
Should numpy.lib.ufunclike.log2 be updated to:
x = nx.asanyarray(x)
if y is None:
y = nx.log2(x)
else:
nx.log2(x, y)
return y
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
On Mon, Jul 20, 2009 at 12:12 PM, Brian Lewis brian.lewi...@gmail.comwrote:
Should numpy.lib.ufunclike.log2 be updated to:
x = nx.asanyarray(x)
if y is None:
y = nx.log2(x)
else:
nx.log2(x, y)
return y
Or perhaps removed since numpy.core.umath.log2
On Jul 16, 2009, at 12:59 AM, Ralf Gommers wrote:
This is not a problem with r_. This is correct behavior. A scalar
float will not cause an array float32 to be upcast.
This was at first counter-intuitive but I found the reason for it in
Guide to Numpy now:
Mixed scalar-array
Just to be clear, in which namespace(s) are we talking about making (or having
made) the change: IIUC, the result you're talking about would be inappropriate
for ufunc.identity.
DG
--- On Mon, 7/20/09, Keith Goodman kwgood...@gmail.com wrote:
From: Keith Goodman kwgood...@gmail.com
On Mon, Jul 20, 2009 at 1:11 PM, David Goldsmithd_l_goldsm...@yahoo.com wrote:
Just to be clear, in which namespace(s) are we talking about making (or
having made) the change: IIUC, the result you're talking about would be
inappropriate for ufunc.identity.
np.identity
np.matlib.identity
Just my 2 cents.
It is duplicated code.
But it is only 3 lines.
identity does not need to handle rectangular matrices and non-principal
diagonals,
therefore it can be reasonably faster (especially for small matrices, I guess).
___
NumPy-Discussion
On Mon, Jul 20, 2009 at 1:44 PM, Citi, Lucalc...@essex.ac.uk wrote:
Just my 2 cents.
It is duplicated code.
But it is only 3 lines.
identity does not need to handle rectangular matrices and non-principal
diagonals,
therefore it can be reasonably faster (especially for small matrices, I
Hi Chuck
2009/7/17 Charles R Harris charlesr.har...@gmail.com:
PyObject* PyTuple_GetItem(PyObject *p, Py_ssize_t pos)
Return value: Borrowed reference.
Return the object at position pos in the tuple pointed to by p. If pos is
out of bounds, return NULL and sets an IndexError exception. It's a
21 matches
Mail list logo