Eric Emsellem wrote: > Hi again > > after some hours of debugging I finally (I think) found the problem: > > numpy.sum([[0,1,2],[2,3,4]]) > 24 > > numpy.sum([[0,1,2],[2,3,4]],axis=0) > array([2, 4, 6]) > > numpy.sum([[0,1,2],[2,3,4]],axis=1) > array([3, 9]) > > > Isn't the first line supposed to act as with "axis=0" by default (see > help numpy.sum!)...??? > Not setting axis=0 it sums everything! > See the Release Notes page on www.scipy.org. It documents everything that has changed. Several things will break old code as indicated.
There are several options for keeping old code working: 1) Use the numpy.oldnumeric compatibility layer which keeps the same definitions and defaults as Numeric 2) Use conversion tools (like the recently added fix_default_axis) tool to automatically insert axis=0 arguments in all code where it is not present (or to automatically change the import to oldnumeric). For the future, you must specify which axis you mean for a Nd array or the code will assume you meant to work over the entire N-d array. We all recognize this is a pain to change. That's why the backward compatibilty options are avaiable and the tools have been written. Believe me, I know what a pain it is. I have had to keep SciPy and Matplotlib working with all the changes to NumPy. -Travis ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion