where is the error?

lajam at caramail.com lajam at caramail.com
Fri Jun 27 05:54:01 EDT 2008


Maybe I didn't explain correctly what i wanted to do. I have a
database and I just want to pick data under a certain criteria. So I
wanted to use a function like nonzero or find or where to find the
line for corresponding to the data following this criteria. So to find
the lines, I used nonzero and it corresponds to the command:

diff_temp=(logical_and(values[:,5] > -2,values[:,5] < 2)).nonzero()

so YES it has SOMETHING to do with the question below.

diff_temp=(array([  0,   6,   7,  10,  14,  15,  16,  17,  21,  22,
24,  25,  26,
        27,  31,  32,  33,  36,  37,  38,  39,  40,  41,  42,  46,
47,
        48,  49,  50,  51,  52,  53,  54,  59,  60,  61,  62,  71,
72,
        73,  74,  75,  80,  81,  82,  83,  84,  85,  86,  87,  88,
89,
        90,  91,  92,  93,  94,  95,  96,  97,  98,  99, 100, 101,
102,
       103, 104, 105, 106, 107, 111, 112, 113, 114, 115, 116]),)

So now I just want to have the data corresponding to those lines.
Thinking that python was a powerful tool, I thought that it was just
possible to assign those line directly in a matrix. So I used the
command:

values_matchup=values_Stumpf[diff_temp_Stumpf,:]

But it didn't work. I'm sure that there is a specific reason. But my
concern was that this command works FINE if I use python on windows xp
but doesn't work if I use python on my linux Ubuntu machine. So I
wondered what was wrong and if there is a easy and simple way to get
directly a new array with the data corresponding to a certain
criteria.

Thanks for the help,
Cedric















More information about the Python-list mailing list