Here are some more features.
1. typecode : — this function returns the data type to which the array is initialized.
2. itemsize : — this function returns the size in bytes of one element of the array.
3. buffer_info () : — returns a tuple representing the address where the array is stored and the number of elements in it.
The datatype of array is: i The itemsize of array is: 4 The buffer info. of array is: (32497808, 6)
4. count () : — This function counts the number of occurrences of the argument mentioned in the array.
5. extend (arr) : — This function appends the entire array mentioned in its arguments to the specified array.
The occurrences of 1 in array is: 2 The modified array is: 1 2 3 1 2 5 1 2 3
6. fromlist (list) : — This function is used to add the list mentioned in its argument to the end of the array .
7. tolist () : — This function is used to convert an array to a list .
Output: p >
The modified array is: 1 2 3 1 2 5 1 2 3 The new list created is: 1 2 3 1 2 5 1 2 3
This article is courtesy of Manjeet Singh . If you are as Python.Engineering and would like to contribute, you can also write an article using contribute.python.engineering or by posting an article contribute @ python.engineering. See my article appearing on the Python.Engineering homepage and help other geeks.
Please post comments if you find anything wrong or if you would like to share more information on the topic discussed above.