From: Alan G I. <ai...@am...> - 2006-06-23 20:52:49
|
> Alan G Isaac wrote:=20 >> Why is a.flat not the same as a.A.flat?=20 On Fri, 23 Jun 2006, Travis Oliphant apparently wrote:=20 > It is the same object except for the pointer to the=20 > underlying array. When asarray(a.flat) get's called it=20 > looks to the underlying array to get the sub-class and=20 > constructs that sub-class (and matrices can never be 1-d). =20 > Thus, it's a "feature"=20 I doubt I will prove the only one to stumble over this. I can roughly understand why a.ravel() returns a matrix; but is there a good reason to forbid truly flattening the matrix? My instincts are that a flatiter object should not have this=20 hidden "feature": flatiter objects should produce=20 a consistent behavior in all settings, regardless of the=20 underlying array. Anything else will prove too surprising. fwiw, Alan |