<div dir="ltr"><div class="gmail_quote"><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="Ih2E3d">Basically, we want a[i][j] == a[i,j]. Since there is no literal syntax for numpy arrays, we need to be able to convert from a sequence of sequences to an array. The indexing needs to correspond between the two.<br>
</div></blockquote><div><br></div><div>Thanks for the reply. I guess that explains the *why*... </div><div> </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Adopt the numpy order. There are many functions in numpy which take an axis= argument just like this. axis=0 means "y" in the terminology that you are using.<br></blockquote></div><div><div><br></div><div>Yes, I agree its best to use the numpy order, and I agree one gets </div>
<div>used to it. However, it will always feel a bit unnatural to reverse the </div><div>order of dimensions (at least to me it does). And I think it can in </div><div>some situations lead to confusion.</div><div><br></div>
<div>I for instance have a class to store sets of points in a nD space. I can </div><div>index the points, so using points[99,0] selects the *first* dimension of </div><div>the 99th point. I use this class to store locations of interesting points in </div>
<div>2D and 3D images. But when programming, it can at times be quite confusing</div><div>switching between reversed and "normal" indexing. And sometimes I</div><div>might have a method that does stuff with an image and a point set and</div>
<div>I want to indicate an axis. What standard should I use then?</div><div><br></div><div>I'm not saying numpy should change the indexing order or something. But </div><div>other people must run into the same confusing situation at times. How do</div>
<div>they handle this?  In the example above, I think it'll be weird to change the </div><div>pointset class such that points[99,0] selects the *last* dimension of point 99. </div><div>Or is it?</div><div><br></div><div>
Cheers,</div><div>  Almar</div></div></div>