On Jul 20, 2009, at 3:44 PM, Christopher Barker wrote:
> ...
> Is there a cleaner way to do this?
>
> -Chris
Yes. np.lib._iotools.LineSplitter and/or np.genfromtxt
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailma
On Jul 21, 2009, at 2:42 AM, Nils Wagner wrote:
>
> Fixed-length fields are quite common e.g. in the area of
> Finite Element pre/postprocessing.
> Therefore It would be nice to have a function like
> line2array in numpy.
> Comments ?
Er, there's already something like that:
np.lib._iotools.LineS
On Mon, 20 Jul 2009 12:44:23 -0700
Christopher Barker wrote:
> Nils Wagner wrote:
>> How can I split the second line in such a way that I get
>>
>> ['-1.00E+00', '-1.00E+00', '-1.00E+00',
>> '-1.00E+00', '1.25E+00', '1.25E+00']
>>
>> instead of
>>
>> ['-1.00E+00-1
On Tue, 21 Jul 2009 15:05:02 +0900
David Cournapeau wrote:
> Nils Wagner wrote:
>> Hi all,
>>
>> I cannot build numpy from svn.
>>
>
> Yes, I don't know why I did not caught this error on my
>machine. In any
> case, it is fixed in r7175.
>
> cheers,
>
> David
Great. Works for me.
Nil
Nils Wagner wrote:
> Hi all,
>
> I cannot build numpy from svn.
>
Yes, I don't know why I did not caught this error on my machine. In any
case, it is fixed in r7175.
cheers,
David
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://m
Hi all,
I cannot build numpy from svn.
...
adding
'build/src.linux-x86_64-2.5/numpy/core/include/numpy/numpyconfig.h'
to sources.
executing numpy/core/code_generators/generate_numpy_api.py
numpy/core/code_generators/../src/multiarray/iterators.c
1778
Traceback (most recent call last):
Fi
Hi Chuck
2009/7/17 Charles R Harris :
> 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 borrowed
> reference
On Mon, Jul 20, 2009 at 1:44 PM, Citi, Luca 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
> guess).
I
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 mai
OK, thanks! (Forgive my being a stickler, but I think it's good to have it in
the thread, for posterity.)
DG
--- On Mon, 7/20/09, Keith Goodman wrote:
> From: Keith Goodman
> Subject: Re: [Numpy-discussion] My identity
> To: "Discussion of Numerical Python"
> Date: Monday, July 20, 2009, 1
On Mon, Jul 20, 2009 at 1:11 PM, David Goldsmith 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 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 wrote:
> From: Keith Goodman
> Subject: Re: [Numpy-discussion] My identity
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 scal
Nils Wagner wrote:
How can I split the second line in such a way that I get
['-1.00E+00', '-1.00E+00', '-1.00E+00',
'-1.00E+00', '1.25E+00', '1.25E+00']
instead of
['-1.00E+00-1.00E+00-1.00E+00-1.00E+00',
'1.25E+00', '1.25E+00']
It looks lik
On Mon, Jul 20, 2009 at 12:12 PM, Brian Lewis wrote:
> 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 exists...
__
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
http://mail.scipy.org/mailman/listi
On Mon, Jul 20, 2009 at 10:53 AM, Pauli Virtanen wrote:
> On 2009-07-20, Keith Goodman 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, dtype=None):
return eye(n, M=
On 2009-07-20, Keith Goodman 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
NumPy-Discussion@scipy.
On Mon, Jul 20, 2009 at 9:32 AM, Keith Goodman wrote:
> On Mon, Jul 20, 2009 at 9:03 AM, Charles R
> Harris wrote:
>>
>>
>> On Mon, Jul 20, 2009 at 9:39 AM, Keith Goodman wrote:
>>>
>>> Using a trick that Robert Kern recently posted to the list makes the
>>> identity function much faster.
>>>
>>>
On Mon, Jul 20, 2009 at 05:27, T J 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 pro
On Mon, Jul 20, 2009 at 9:03 AM, Charles R
Harris wrote:
>
>
> On Mon, Jul 20, 2009 at 9:39 AM, Keith Goodman 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 = arra
On Mon, Jul 20, 2009 at 01:42, Nicolas Pinto 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 implementing fu
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 9:39 AM, Keith Goodman 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)
>b.flat =
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)
b.flat = a
return b
Proposed version:
def myidentity(n, dtype=None):
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
http://www.nabble.com/recarray-and-datetime-objects-td245683
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 tryin
On Mon, 11 May 2009 10:48:14 -0400
Alan G Isaac 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
>
>
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 somet
29 matches
Mail list logo