Arrays In Python:

Python for Data ScienceAn 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:
  1. 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.

Understanding Arrays in Python for Data Science - PST Analytics

  1. append() : This adds value to the end of the array, which is mentioned in the argument.
  2. insert(I,x) : There to add value to the position mentioned in the argument.

Understanding Arrays in Python for Data Science - PST AnalyticsUnderstanding Arrays in Python for Data Science - PST Analytics

  1. pop() : This removes the element specified in the argument and returns the deleted element.
  2. remove() : This removes the initial occurrence of the value specified in its argument.

  1. index() : It returns the initial occurrence of the value specified in the argument.
  2. reverse() : It is there to reverse the array.

# Python code for data science demonstrating the work of

# index() and reverse()

To learn more, you can check this and this.

Leave a Reply

Your email address will not be published. Required fields are marked *