Newsgroups: comp.lang.python
From: bearophileH...@lycos.com
Date: Fri, 18 Jan 2008 16:37:49 -0800 (PST)
Local: Fri, Jan 18 2008 7:37 pm
Subject: Re: Efficient processing of large nuumeric data file
Matt:
> from collections import defaultdict But usually in tight loops exceptions slow down the Python code, so > def get_hist(file_name): this is quite faster (2.5 times faster with Psyco, about 2 times without, with about 30% of lines with a space in it): import psyco def get_hist(file_name): for line in open(file_name): return hist psyco.bind(get_hist) It doesn't work if lines may contain spurious spaces... Bye, You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||