ezarrays Python Module Reference

 

MultiArray Class Reference

Array2DEZ Arrays

<classdoc Multi Array> <descp> Defines a true multi-dimensional array of 2 or more dimensions. The elements of the array, which store Python references, can be accessed using subscript notation, x[i, j]. A multi-dimensional array is implemented as a single 1-D array with the elements stored in "row-major" order.

<figure img="3darray.jpg" size="200px"> </descp>

<method Multi Array params="d1, d2, ... dN"> <descp> Creates a multi-dimensional array organized into N-dimensions. The number of dimensions is based on the number of arguments provided and the value of each argument determines the length of each dimension. The elements of the array are initialized to None. </descp> <param d1, d2, ... dN> The size or length of each dimension of the array. The dimensions are specified from highest to lowest, where d1 is the highest possible dimension and dN the lowest. N must be >= 2. </param> </method>

<method dims> <descp> Returns the number of dimensions in the multi-dimensional array. </descp> <returns>The number of dimensions.</returns> </method>

<method length params="dim"> <descp> Returns the length of the given dimension. </descp> <param dim> The dimension of the N-dimensional array for which the length is returned. The dimensions are numbered from 1 through N, with dimension 1 being the highest dimension and dimension N being the lowest. </param> <returns>The length of the given dimension.</returns> </method>

<method clear> <descp> Clears the array by setting every element to None. </descp> </method>

<method clear params="value"> <descp> Sets every element to a given value. All of the elements will reference the same object, not separate copies. </descp> <param value>The value to be stored in each element of the array.</param> </method>

<method __getitem__ op="v = x[i1, i2, ... iN]"> <descp> Returns the value stored in an element of the array. </descp> <param i1, i2, ... iN> The position of the element whose value is to be returned. The position of an element is defined by the index of that element within each dimension. There must be one index value for each dimension of the array and all indices must be >= 0 and less than the length of the given dimension. </param> <returns>The value stored in the given array element.</returns> <throws>IndexError</throws> </method>

<method __setitem__ op="x[i1, i2, ... iN] = value"> <descp> Stores a new value into a specific element of the array. The contents of the array element in the given row and column is changed to value. </descp> <param i1, i2, ... iN> The position of the element whose value is to be changed. The position of an element is defined by the index of that element within each dimension. There must be one index value for each dimension of the array and all indices must be >= 0 and less than the length of the given dimension. </param> <returns>The value stored in the given array element.</returns> <throws>IndexError</throws>

</method>

</classdoc>

Array2DEZ Arrays
Print -- Recent Changes
Page last modified on March 06, 2013, at 04:24 PM