Dictionary question.

2005-04-21 Thread hawkesed
Hi, I am semi new to Python. Here is my problem : I have a list of 100 random integers. I want to be able to construct a histogram out of the data. So I want to know how many 70's, 71's, etc. I can't figure out how to do this. A dictionary is supposedly can do key value pairs right? I want to be

Re: Dictionary question.

2005-04-21 Thread hawkesed
Here is an example of the input list: [101, 66, 75, 107, 108, 101, 106, 98, 111, 88, 119, 93, 115, 95, 114, 95, 118, 109, 85, 75, 88, 97, 53, 78, 98, 91, 115, 77, 107, 153, 108, 101] Here is the code I am working on now: >>> for num in alist: ... if adict.has_key(num): ... x = adic

Re: Dictionary question.

2005-04-21 Thread hawkesed
Steve, thanks for the input. That is actually what I am trying to do, but I don't know the syntax for this in python. For example here is a list I want to work with as input: [101, 66, 75, 107, 108, 101, 106, 98, 111, 88, 119, 93, 115, 95, 114, 95, 118, 109, 85, 75, 88, 97, 53, 78, 98, 91, 115, 77

Re: Dictionary question.

2005-04-21 Thread hawkesed
Actually, I think I got it now. Here is what I did: >>> for num in alist: ... if adict.has_key(num): ... x = adict.get(num) ... x = x + 1 ... adict.update({num:x}) ... else: ... adict.update({num:1}) ... >>> adict {128: 2, 129: 2, 132: 1, 15

setting up scipy in windows

2005-05-17 Thread hawkesed
Hi All, has anyone out there recently set up scipy on Windows? Cause I am trying to do so know and I am not having much luck. I have ActiveState and Plone. When I try to import scipy in ActiveState it says >>> import scipy Traceback (most recent call last): File "", line 1, in ? ImportError: No

Re: setting up scipy in windows

2005-05-25 Thread hawkesed
typing in pythonwin >>> from scipy import * >>> Then played around with some of the methods. Pretty cool stuff. Thanks all! Frithiof Andreas Jensen wrote: > "hawkesed" <[EMAIL PROTECTED]> skrev i en meddelelse > news:[EMAIL PROTECTED] > > > > S

Counting elements in a list wildcard

2006-04-24 Thread hawkesed
If I have a list, say of names. And I want to count all the people named, say, Susie, but I don't care exactly how they spell it (ie, Susy, Susi, Susie all work.) how would I do this? Set up a regular expression inside the count? Is there a wildcard variable I can use? Here is the code for the non-