python version of nnls/fnnls

Dear matplotlibers,

I seem to use Non Negative Least Squares every couple of months and the most recent problem I solved reminded me that I meant to post this last November. is a port of fnnls.m which was written by Rasmus Bro (, code available at, and also available on Matlab Central).

I’ve retained Rasmus’ comments and translated the matlab to python/numpy. (4.38 KB)

And it is ... where?

Alan Isaac


On Thu, 25 May 2006, Graeme O'Keefe apparently wrote: