ezarrays Python Module Reference

 

Array2D Class Reference

ArrayEZ ArraysMultiArray

<classdoc Array 2 D> <descp> Defines a two-dimensional array with the elements organized into rows and columns. The array is defined with a limited number of operations similar those provided in other languages. The elements of the array, which store Python references, can be accessed using normal subscript notation, x[i, j]. The class is implemented as an array of arrays.

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

<method Array 2 D params="nrows, ncols"> <descp> Creates a two-dimensional array with elements organized into rows and columns. The number of rows and columns in the array are provided as arguments. The elements are initialized to None. The elements of the array are accessed by row and column position with the first element of each row and each column having an index of 0. </descp> <param nrows>The number of rows in the array, which must be >= 1.</param> <param ncols>The number of columns in the array, which must be >= 1.</param> </method>

<method numRows> <descp> Returns the number of rows in the 2-D array. </descp> <returns>The number of rows in the array.</returns> </method>

<method numCols> <descp> Returns the number of columns in the 2-D array. </descp> <returns>The number of columns in the array.</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 in the array 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="value = x(:row , col:)"> <descp> Returns the value stored in an element of the array. </descp> <param row> The row index of the element whose value is to be returned. It must be >= 0 and less than the number of rows in the array. </param> <param col> The column index of the element whose value is to be returned. It must be >= 0 and less than the number of columns in the array. </param> <returns>The value stored in the given array element.</returns> <throws>IndexError</throws> </method>

<method __setitem__ op="x(:row , col:) = 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 row> The row index of the element to be changed. It must be >= 0 and less than the number of rows in the array. </param> <param col> The column index of the element to be changed. It must be >= 0 and less than the number of columns in the array. </param> <param value>The new value to be stored in the given element.</param> <throws>IndexError</throws> </descp> </method>

</classdoc>

ArrayEZ ArraysMultiArray
Print -- Recent Changes
Page last modified on March 06, 2013, at 04:20 PM