<div dir="ltr"><div dir="ltr">Dear András,</div><div dir="ltr"><br></div><div>Try those different option in MATLAB for example. or Octave/Scilab/Sympy-Matrix... they are all the same. The term "multidimensional arrays"  is a little bit vague. one might think of multidimensional matrices ( I don't think there is such a thing in math) if coming from MATLAB. I also think the row-major column major terminology is confusing. there are no rows or columns for that matter. Numpy ndarrays are homogeneous, uniform nested lists. one can represent different layers of this list in different ways using rows or columns. </div><div><br></div><div>regardless of all these different point of views having graphical and pretty printing representations would help a lot. that's my main goal at the moment. </div><div><br></div><div>Best,</div><div>Foad</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 6, 2018 at 11:43 AM Andras Deak <<a href="mailto:deak.andris@gmail.com">deak.andris@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, Nov 6, 2018 at 8:26 AM Foad Sojoodi Farimani<br>
<<a href="mailto:f.s.farimani@gmail.com" target="_blank">f.s.farimani@gmail.com</a>> wrote:<br>
><br>
> Dear Mark,<br>
><br>
> Thanks for the reply. I will write in between your lines:<br>
><br>
> On Tue, Nov 6, 2018 at 6:11 AM Mark Harfouche <<a href="mailto:mark.harfouche@gmail.com" target="_blank">mark.harfouche@gmail.com</a>> wrote:<br>
>><br>
>> Foad,<br>
>><br>
>> Visualizing data is definitely a complex field. I definitely feel your pain.<br>
><br>
> I have actually been using numpy for a couple of years without noticing these issues. recently I have been trying to encourage my collogues to move from MATLAB to Python and also prepare some workshops for PhD network of my university.<br>
>><br>
>> Printing your data is but one way of visualizing it, and probably only useful for very small and constrained datasets.<br>
><br>
> well actually it can be very useful. Consider Pandas .head() and .tail() methods or Sympy's pretty printing functionalities. for bigger datasets the function can get the terminals width and height and then based on the input (U(n),D(n),L(n),R(n),UR(n,m),UL(n,m),DR(n,m),DL(n,m)) display what can be shown and put horizontal 3-dots \u2026 … or vertical/inclined ones. Or id it is Jupyter then one can use Markdown/LaTeX for pretty printing or even HTML to add sliders as suggested by Eric.<br>
>><br>
>> Have you looked into set_printoptions to see how numpy’s existing capabilities might help you with your visualization?<br>
><br>
> This is indeed very useful. specially the threshold option can help a lot with adjusting the width. but only for specific cases.<br>
>><br>
>> The code you showed seems quite good. I wouldn’t worry about performance when it comes to functions that will seldom be called in tight loops.<br>
><br>
> Thanks but I know it is very bad:<br>
><br>
> it does not work properly for floats<br>
> it only works for 1D and 2D<br>
> there can be some recursive function I believe.<br>
>><br>
>> As you’ll learn more about python and numpy, you’ll keep expanding it to include more use cases.<br>
>> For many of my projects, I create small submodules for visualization tailored to the specific needs of the particular project.<br>
>> I’ll try to incorporate your functions and see how I use them.<br>
><br>
> Thanks a lot. looking forwards to your feedback<br>
>><br>
>> Your original post seems to have some confusion about C Style vs F Style ordering. I hope that has been resolved.<br>
><br>
> I actually came to the conclusion that calling it C-Style or F-Style or maybe row-major column-major are bad practices. Numpy's ndarrays are not mathematical multidimensional arrays but Pythons nested, homogenous and uniform lists.  it means for example 1, [1], [[1]] and [[[1]]] are all different, while in all other mathematical languages out there (including Sympy's matrices) they are the same.<br>
<br>
I'm probably missing your point, because I don't understand your<br>
claim. Mathematically speaking, 1 and [1] and [[1] and [[[1]]] are<br>
different objects. One is a scalar, the second is an element of R^n<br>
with n=1 which is basically a scalar too from a math perspective, the<br>
third one is a 2-index object (an operator acting on R^1), the last<br>
one is a three-index object. These are all mathematically distinct.<br>
Furthermore, row-major and column-major order are a purely technical<br>
detail describing how the underlying data that is being represented by<br>
these multidimensional arrays is laid out in memory. So C/F-style<br>
order and the semantics of multidimensional arrays, at least as I see<br>
it, are independent notions.<br>
<br>
András<br>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@python.org" target="_blank">NumPy-Discussion@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/numpy-discussion" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/numpy-discussion</a><br>
</blockquote></div>