[Numpy-discussion] Release of NumPy

Alan Isaac aisaac@american....
Wed Apr 16 12:57:49 CDT 2008

On Wed, 16 Apr 2008, Gael Varoquaux wrote:
> let us pretend A[:, 1] returns a 1D array, as you seem to 
> be wanting 

Where did I say anything like that??
Please look at the proposal.
It affects **only** scalar indexing
(and thereby iteration).

Recall how emphatically I agreed with you:
Multiple indexes should always return
submatrices, and the right way to get
submatrices is with multiple indexes.
I have proposed no change in the
behavior of non-scalar indexes.

I specify an actual code change on the
page you asked me to create.
It is a trivial change in __getitem__.
It does not lead to any of the breakage
you suggest, because it does not change
the behavior you consider.  Please look:
it changes *only* the processing of
a scalar index.  Since I'm not familiar
with NumPy internals, I offer this only
to pin down what I am talking about,
not as a proposed code change.  But it
should make it clear that I am not asking
what you suggest.

AND (!!) my proposed change means that
A[x][y] == A[x, y]
which is not currently true.
One good thing has come out of this discussion:
as far as I can tell, everyone agrees that
there should be a change such that
A[x][y] == A[x, y]
I believe I am proposing the simplest change,
which leaves matrices as much like ndarrays
as possible.

My main objection to Stefan's proposal is
that it adds substantial complexity for no
apparent gain.  Charles may have been
suggesting that he can see a substantial
gain: his comment was too cryptic for me.
If so, I would be interested.


More information about the Numpy-discussion mailing list