Numpy arrays come with several reduce operations: sum(), std(), argmin(), min(), ....
The traditional implementation of these suffers from two big problems: It is slow and it often allocates intermediate memory. I have code that is failing with OOM (out of memory) exceptions in calls to ndarray.std(). I regularly handle arrays with 100 million entries (have a couple of million objects * 20 features per object = 100 million doubles), so this is a real problem for me.
The open source Python Morphology Toolbox is a very nice piece of software, written by Roberto A. Lutofu and Rubens C. Machado. Unfortunately, the code has been allowed to rot and does not work with the more recent numpy libraries.
Since discovering their code, I have been using it with random patches to the functions I needed. Recently, I decided to perform a fuller code clean up and release it publicly in the hope that it would be useful to others.
A very simple reader/writer for FASTA encoded DNA sequences.
# -*- coding: utf-8 -*- # Copyright 2006 INESC/ID # Written by Luís Pedro Coelho# # Licence: MIT Licence: # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the rights to # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies