diff options
author | Madhusudan.C.S | 2009-10-09 12:59:55 +0530 |
---|---|---|
committer | Madhusudan.C.S | 2009-10-09 12:59:55 +0530 |
commit | b6de26b18b28a244643c671bd71ed92a88555ad4 (patch) | |
tree | ef3d4f9df2ceb21bd708acf5c953f176f619eb24 /day1/exercise/kwfreq.py | |
parent | 2f5e0db52e85b5e138ce74d87a7391d9a7276cd0 (diff) | |
download | workshops-more-scipy-b6de26b18b28a244643c671bd71ed92a88555ad4.tar.gz workshops-more-scipy-b6de26b18b28a244643c671bd71ed92a88555ad4.tar.bz2 workshops-more-scipy-b6de26b18b28a244643c671bd71ed92a88555ad4.zip |
Final set of changes.
Diffstat (limited to 'day1/exercise/kwfreq.py')
-rw-r--r-- | day1/exercise/kwfreq.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/day1/exercise/kwfreq.py b/day1/exercise/kwfreq.py index 32a8765..0da7ff3 100644 --- a/day1/exercise/kwfreq.py +++ b/day1/exercise/kwfreq.py @@ -1,5 +1,5 @@ import keyword -f = open('/home/madhu/pyprogs/pytriads.py') +f = open('/path/to/file') freq = {} for line in f: @@ -7,7 +7,7 @@ for line in f: for word in words: key = word.strip(',.!;?()[]: ') if keyword.iskeyword(key): - value = freq.get(key, 1) + value = freq[key] freq[key] = value + 1 print freq |