An array contains specified data types. To handle array in Python for data science we have a specific module called “array”. These are helpful to manipulate only the specific data type values.
Operations on Array:
- Array(data type and values): It is a function there to create an array with specified data types and values mentioned in its arguments. The table below shows some data types.
- append() : This adds value to the end of the array, which is mentioned in the argument.
- insert(I,x) : There to add value to the position mentioned in the argument.
- pop() : This removes the element specified in the argument and returns the deleted element.
- remove() : This removes the initial occurrence of the value specified in its argument.
- index() : It returns the initial occurrence of the value specified in the argument.
- reverse() : It is there to reverse the array.
# Python code for data science demonstrating the work of
# index() and reverse()