|
From: Dimitri D'O. <dim...@fs...> - 2005-07-27 09:04:25
|
Didrik, What do you propose as a solution for this potential bug with "rank"? I frequently use "rank" to test the dimensionality of a matrix or a = vector. Should I replace it by "len(A.shape)" or import it as Nrank? The second solution seems to be clearer for me. But then how do I have = to import the modules? from scipy import * from scipy import rank as Nrank from pylab import * Another solution would be to import "rank" as "dim" to match the Matlab function name. Or from scipy import * from scipy import Numeric as N from pylab import * With this last import scheme, N.rank should be used to test = dimensionality while rank gives the rank of a matrix (from pylab). Which would be the best way to import the modules? Dimitri _______________________________________________ Dr. Dimitri D'Or Agricultural Engineer, Ph.D.=20 Environmental Resources Consultant for FSS International Tienne-de-Mont, 10 5140 Sombreffe Belgique =20 T=E9l. : +32-71-81.43.60 e-mail : dim...@fs... Web site : http://www.fssintl.com/ Le groupe de travail fran=E7ais GeoSiPol : http://www.geosipol.org =20 Upcoming events: Sites pollu=E9s : Pratique de l'investigation et de l'assainissement, Neuch=E2tel (Suisse) Cours de formation continue du 31 mai au 3 juin et 13-14 octobre 2005. _______________________________________________ > -----Message d'origine----- > De=A0: bme...@li... = [mailto:bmelibpy-devel- > ad...@li...] De la part de Didrik Pinte > Envoy=E9=A0: jeudi 14 juillet 2005 15:05 > =C0=A0: bme...@li... > Objet=A0: [Bmelibpy-devel] rank function >=20 > For your information, potential bug source: >=20 > ---------------------------------------------------------------------- > Help on function rank in module Numeric: >=20 > rank(a) > Get the rank of sequence a (the number of dimensions, not a matrix > rank) > The rank of a scalar is zero. >=20 > ---------------------------------------------------------------------- >=20 > Help on function rank in module matplotlib.mlab: >=20 > rank(x) > Returns the rank of a matrix. > The rank is understood here as the an estimation of the number of > linearly independent rows or columns (depending on the size of the > matrix). > Note that numerix.mlab.rank() is not equivalent to Matlab's rank. > This function is! >=20 > Didrik |