On Sun, Sep 21, 2008 at 7:51 PM, Dinesh B Vadhia
<[EMAIL PROTECTED]>wrote:
> Ooops, I should have said that this is easy to do with 2 for loops ie.
>
> import numpy
> from collections import defaultdict
> A =
> [[1 6 1 2 3]
> [4 5 4 7 0]
> [2 0 8 0 2]
> [0 0 0 3 7]
> [0 7 0 3 5]
> [8 0 3 0 6
On Sun, Sep 21, 2008 at 1:28 PM, Dinesh B Vadhia
<[EMAIL PROTECTED]> wrote:
>
> But, I want to pick up the column index of non-zero elements per row.
>
http://www.scipy.org/Numpy_Example_List_With_Doc#nonzero
--
Nathan Bell [EMAIL PROTECTED]
http://graphics.cs.uiuc.edu/~wnbell/
_
Ooops, I should have said that this is easy to do with 2 for loops ie.
import numpy
from collections import defaultdict
A =
[[1 6 1 2 3]
[4 5 4 7 0]
[2 0 8 0 2]
[0 0 0 3 7]
[0 7 0 3 5]
[8 0 3 0 6]
[8 0 0 2 2]
[3 1 0 4 0]
[5 0 8 0 0]
[2 1 0 5 6]]
dict = defaultdict(list)
I = A.shape[0]
Hi! Say, I've got a numpy array/matrix of the form:
A =
[[1 6 1 2 3]
[4 5 4 7 0]
[2 0 8 0 2]
[0 0 0 3 7]
[0 7 0 3 5]
[8 0 3 0 6]
[8 0 0 2 2]
[3 1 0 4 0]
[5 0 8 0 0]
[2 1 0 5 6]]
I want to create a dictionary of row indexes (as the keys) mapped to lists of
the column indexes of non-zer
David Cournapeau wrote:
>
> The isnan thing is surprising, because the whole point to have a isnan
> is that you can do it without branching. I checked, and numpy does use
> the macro of isnan, not the function (glibc has both).
Ok, see my patch #913 for this. The slowdown is actually specific to
Robert Kern wrote:
> On Sun, Sep 21, 2008 at 02:26, Robert Cimrman <[EMAIL PROTECTED]> wrote:
>> Cool, then I have another one:
>>
>> $ ./kernprof.py -l pystone.py
>> Traceback (most recent call last):
>> File "./kernprof.py", line 173, in ?
>> sys.exit(main(sys.argv))
>> File "./kernprof.p
On Sun, Sep 21, 2008 at 02:26, Robert Cimrman <[EMAIL PROTECTED]> wrote:
> Cool, then I have another one:
>
> $ ./kernprof.py -l pystone.py
> Traceback (most recent call last):
> File "./kernprof.py", line 173, in ?
> sys.exit(main(sys.argv))
> File "./kernprof.py", line 138, in main
>
On Sun, Sep 21, 2008 at 12:56 AM, David Cournapeau <
[EMAIL PROTECTED]> wrote:
> David Cournapeau wrote:
> > Anne Archibald wrote:
> >> If users are concerned about performance, it's worth noting that on
> >> some machines nans force a fallback to software floating-point
> >> handling, with a corr
Robert Kern wrote:
> On Sun, Sep 21, 2008 at 02:09, Robert Cimrman <[EMAIL PROTECTED]> wrote:
>> Robert Kern wrote:
>>> On Fri, Sep 19, 2008 at 07:00, Robert Cimrman <[EMAIL PROTECTED]> wrote:
Robert Kern wrote:
> Ah, found it. T_LONGLONG is a #define from structmember.h which is
> use
On Sun, Sep 21, 2008 at 02:09, Robert Cimrman <[EMAIL PROTECTED]> wrote:
> Robert Kern wrote:
>> On Fri, Sep 19, 2008 at 07:00, Robert Cimrman <[EMAIL PROTECTED]> wrote:
>>> Robert Kern wrote:
Ah, found it. T_LONGLONG is a #define from structmember.h which is
used to describe the types of
David Cournapeau wrote:
> Anne Archibald wrote:
>> If users are concerned about performance, it's worth noting that on
>> some machines nans force a fallback to software floating-point
>> handling, with a corresponding very large performance hit. This
>> includes some but not all x86 (and I think x
Robert Kern wrote:
> On Fri, Sep 19, 2008 at 07:00, Robert Cimrman <[EMAIL PROTECTED]> wrote:
>> Robert Kern wrote:
>>> Ah, found it. T_LONGLONG is a #define from structmember.h which is
>>> used to describe the types of attributes. Apparently, this was not
>>> added until Python 2.5. That particul
Anne Archibald wrote:
>
> If users are concerned about performance, it's worth noting that on
> some machines nans force a fallback to software floating-point
> handling, with a corresponding very large performance hit. This
> includes some but not all x86 (and I think x86-64) CPUs. How this
> comp
13 matches
Mail list logo