array.array.insert()

array.insert(i, x) Insert a new item with value x in the array before position i. Negative values are treated as being relative to the end of the array.

array.array.index()

array.index(x) Return the smallest i such that i is the index of the first occurrence of x in the array.

array.array.fromunicode()

array.fromunicode(s) Extends this array with data from the given unicode string. The array must be a type 'u' array; otherwise a ValueError is raised. Use array.frombytes(unicodestring.encode(enc)) to append Unicode data to an array of some other type.

array.array.fromstring()

array.fromstring() Deprecated alias for frombytes().

array.array.fromlist()

array.fromlist(list) Append items from the list. This is equivalent to for x in list: a.append(x) except that if there is a type error, the array is unchanged.

array.array.fromfile()

array.fromfile(f, n) Read n items (as machine values) from the file object f and append them to the end of the array. If less than n items are available, EOFError is raised, but the items that were available are still inserted into the array. f must be a real built-in file object; something else with a read() method won’t do.

array.array.frombytes()

array.frombytes(s) Appends items from the string, interpreting the string as an array of machine values (as if it had been read from a file using the fromfile() method). New in version 3.2: fromstring() is renamed to frombytes() for clarity.

array.array.extend()

array.extend(iterable) Append items from iterable to the end of the array. If iterable is another array, it must have exactly the same type code; if not, TypeError will be raised. If iterable is not an array, it must be iterable and its elements must be the right type to be appended to the array.

array.array.count()

array.count(x) Return the number of occurrences of x in the array.

array.array.byteswap()

array.byteswap() “Byteswap” all items of the array. This is only supported for values which are 1, 2, 4, or 8 bytes in size; for other types of values, RuntimeError is raised. It is useful when reading data from a file written on a machine with a different byte order.