An ArrayList is a strongly typed list whose type can be anything that can be interpreted as a numpy data type.
>>> L = ArrayList( [[0], [1,2], [3,4,5], [6,7,8,9]] ) >>> print L [ [0] [1 2] [3 4 5] [6 7 8 9] ] >>> print L.data [0 1 2 3 4 5 6 7 8 9]
You can add several items at once by specifying common or individual size: a single scalar means all items are the same size while a list of sizes is used to specify individual item sizes.
>>> L = ArrayList( np.arange(10), [3,3,4]) >>> print L [ [0 1 2] [3 4 5] [6 7 8 9] ] >>> print L.data [0 1 2 3 4 5 6 7 8 9]
vispy.visuals.collections.array_list.
ArrayList
Bases: object
object
append
Append data to the end.
An array, any object exposing the array interface, an object whose __array__ method returns an array, or any (nested) sequence.
If `itemsize is an integer, N, the array will be divided into elements of size N. If such partition is not possible, an error is raised.
If itemsize is 1-D array, the array will be divided into elements whose succesive sizes will be picked from itemsize. If the sum of itemsize values is different from array size, an error is raised.
data
The array’s elements, in memory.
dtype
Describes the format of the elements in the buffer.
insert
Insert data before index
Index before which data will be inserted.
itemsize
Individual item sizes
reserve
Set current capacity of the underlying array
size
Number of base elements, in memory.