| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Stop wasting time looking for files and revisions. Connect your Gmail, DriveDropbox, and Slack accounts and in less than 2 minutes, Dokkio will automatically organize all your file attachments. Learn more and claim your free account.

View
 

TuningTricks

Page history last edited by PBworks 12 years, 1 month ago

from email list optimizing histogram of numbers in huge file

 

- wrap your code in a function. Functions run much faster in python than module level code,

- look into using collections.defaultdict for histogram. A dictionary is a very appropriate way to store this data. numpy is good for processing numeric data once they are already in arrays, not for populating them.

 

Both Python "array.array" and "list" are implemented as dyn arrays, not as C-like linked lists.

Comments (0)

You don't have permission to comment on this page.