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

  • Dokkio Sidebar (from the makers of PBworks) is a Chrome extension that eliminates the need for endless browser tabs. You can search all your online stuff without any extra effort. And Sidebar was #1 on Product Hunt! Check out what people are saying by clicking here.

View
 

TuningTricks

Page history last edited by PBworks 14 years 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.