NumPy for Data Science – Part 5

The difference between copy and view

Copy

  • The copy owns the data
  • The copy of an array is a new array.
  • The changes made in the copy data does not reflect in the original array.

View

  • The view does not own the data
  • A view of the original array.
  • Any changes made in the view will affect the original array, and any changes made in the original array will affect the view.

Join & split function

Join array – joining means putting contents of two or more array in a single array.

hstack vs vstack

The major difference is that np.hstack combines NumPy arrays horizontally and np.vstack combines arrays vertically.

Split – splitting breaks one array into multiple.

NumPy for Data Science – Part 1

NumPy for Data Science – Part 2

NumPy for Data Science – Part 3

NumPy for Data Science – Part 4

Popular Posts

Author

Spread the knowledge
 
  

Leave a Reply

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