Alan Gauld wrote:
"Norman Khine" <[EMAIL PROTECTED]> wrote
Frankly I'd use a database. Just load the data into it using Python.
Then execute SQL querioes to get the counts etc.
Not really an option to use SQL just for this.
I'm curious why?
It seems to suggest that using SQL is somehow a
On Tue, Jul 1, 2008 at 7:03 AM, Norman Khine <[EMAIL PROTECTED]> wrote:
> Kent Johnson wrote:
>> for first in x:
>> for second in y:
>>if first and second and (first, second) in table:
>
> I don't really see this clearly as I may have n'th values for 'x' and n'th
> values for 'y' so I will nee
"Norman Khine" <[EMAIL PROTECTED]> wrote
Frankly I'd use a database. Just load the data into it using
Python.
Then execute SQL querioes to get the counts etc.
Not really an option to use SQL just for this.
I'm curious why?
It seems to suggest that using SQL is somehow a big deal?
But with
On Tue, Jul 1, 2008 at 6:27 AM, Alan Gauld <[EMAIL PROTECTED]> wrote:
> "Kent Johnson" <[EMAIL PROTECTED]> wrote
>>>
>>> if isinstance(x, list):
>>> for item in x:
>>> x = item
>>
>> This just assigns x to the last element of the list
>
> Oops, yes, I said
Kent Johnson wrote:
On Tue, Jul 1, 2008 at 3:09 AM, Norman Khine <[EMAIL PROTECTED]> wrote:
x = getattr(brain, horizontal)
if isinstance(x, list):
for item in x:
x = item
This just assigns x to the last element of the list, it doesn't
Hi,
Alan Gauld wrote:
"Norman Khine" <[EMAIL PROTECTED]> wrote
Here is the 'full' code as such which gets the data from the files.
Unfortunately trying to read this is still difficult since we don't
know what the structure of x, horizontal_criterias, vertical_criterias,
or brains is like.
"Kent Johnson" <[EMAIL PROTECTED]> wrote
if isinstance(x, list):
for item in x:
x = item
This just assigns x to the last element of the list
Oops, yes, I said the first but in fact reassigning x does
not stop the loop, it seems the loop works on a
On Tue, Jul 1, 2008 at 3:09 AM, Norman Khine <[EMAIL PROTECTED]> wrote:
>x = getattr(brain, horizontal)
>if isinstance(x, list):
>for item in x:
>x = item
This just assigns x to the last element of the list, it doesn't
process the whole
"Norman Khine" <[EMAIL PROTECTED]> wrote
Here is the 'full' code as such which gets the data from the files.
Unfortunately trying to read this is still difficult since we don't
know what the structure of x, horizontal_criterias,
vertical_criterias,
or brains is like.
## Classify t
Hi,
Here is the 'full' code as such which gets the data from the files.
## Classify the users
table = {}
table[('', '')] = 0
for x in horizontal_criterias:
table[(x['id'], '')] = 0
for y in vertical_criterias:
table[('', y['id'])] =
Hi Norman,
Norman Khine wrote:
>
> for brain in brains:
> x = getattr(brain, horizontal)
> x = string.join(x, '' )
> y = getattr(brain, vertical)
> y = string.join(y, '' )
> if x and y and (x, y) in table:
> table
Hi,
Sorry, but this did not work.
I have done this, which returns the values I want (sort of)
for brain in brains:
x = getattr(brain, horizontal)
if isinstance(x, list):
for item in x:
x = item
else:
"Norman Khine" <[EMAIL PROTECTED]> wrote
but when I run this, I get the following error on the line:
if x and y and (x, y) in table:
TypeError: list objects are unhashable
Please post the entire error. The tiny bit you posted was
not overly helpful, usually the stacjk trace contains the
ac
Le Monday 30 June 2008 21:31:35, vous avez écrit :
> Thanks,
> but where do i replace the x with tuple(x)
>
Whenever x is hashed, ie used as a key in a dictionary. You said you have:
> >> table[(x, y)] += 1
> >> where:
> >>
> >> x = ['airlines-scheduled', 'airport-car-parking']
Thanks,
but where do i replace the x with tuple(x)
Norman
Cédric Lucantis wrote:
Le Monday 30 June 2008 20:55:36 Norman Khine, vous avez écrit :
Hello,
I would like to count list items but am not 100% sure how to do it.
Here is what I have so far:
for brain in brains:
Le Monday 30 June 2008 20:55:36 Norman Khine, vous avez écrit :
> Hello,
>
> I would like to count list items but am not 100% sure how to do it.
>
> Here is what I have so far:
>
> for brain in brains:
> x = getattr(brain, horizontal)
> y = getattr(brain, vertical
Hello,
I would like to count list items but am not 100% sure how to do it.
Here is what I have so far:
for brain in brains:
x = getattr(brain, horizontal)
y = getattr(brain, vertical)
if x and y and (x, y) in table:
table[(x, y)] += 1
17 matches
Mail list logo