This is a quick tutorial and here I'll show you how-to do some statistical programming tasks using python. For that, is necessary to have some basic knowledge with python and be familiar with statistical programming in a language like R, Stata, SAS, SPSS or Matlab.Please click here to see this post in pdf. In my post previous therewas some examples contained matrices or other data structures ofhigher dimensionalityjust one-dimensional vectors. To understandhow NumPy treats objects with dimensions greater than one, we need todevelop at least a superficial understanding for the way NumPy isimplemented. It is misleading to think of NumPy as a matrixpackage for Python (although its commonly used as such). I findit more helpful to think of NumPy as a wrapper and access layer forunderlying C buffers. These buffers are contiguous blocks of Cmemory, whichby their natureare one-dimensional datastructures. All elements in those data structures must be of the samesize, and we can specify almost any native C type (including Cstructs) as the type of the individual elements. The default typecorresponds to a C double and that is what we use in the examplesthat follow, but keep in mind that other choices are possible. Alloperations that apply to the data overall are performed in C and aretherefore very fast.To interpret the data asa matrix or other multidimensional data structure, the shape orlayout is imposed during element access. The same 12-element datastructure can therefore be interpreted as a 12-element vector or a34 matrix or a 223 tensorthe shape comes into play onlythrough the way we access the individual elements. (Keep in mind thatalthough reshaping a data structure is very easy, resizing is not.)The encapsulation of the underlying C data structures is not perfect:when choosing thetypes of the atomicelements, we specify C data types not Python types. Similarly, somefeatures provided by NumPy allow us to manage memory manually, ratherthan have the memory be managed transparently by the Python runtime.This is an intentional design decision, because NumPy has beendesigned to accommodate large data structureslarge enough that youmight want (or need) to exercise a greater degree of control over theway memory is managed. For this reason, you have the ability tochoose types that take up less space as elements in a collection(e.g., C float elements rather than the default double). For the samereason, all ufuncs accept an optional argument pointing to an(already allocated) location where the results will be placed,thereby avoiding the need to claim additional memory themselves.Finally, several access and structuring routines return a view (not acopy!) of the same underlying data. This does pose an aliasingproblem that you need to watch out for.The next listing quicklydemonstrates the concepts of shape and views. Here, I assume that thecommands are entered at an interactive Python prompt (shown as >>>in the listing). Output generated by Python is shown without aprompt:Lets step throughthis. We create two vectors of 12 elements each. Then we reshape thefirst one into a 3 4 matrix. Note that the shape property is adata membernot an accessory function! For the second vector, wecreate a view in the form of a 3 4 matrix.