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

  • Naveen Pandey Data Scientist Machine Learning Engineer

    Naveen Pandey has more than 2 years of experience in data science and machine learning. He is an experienced Machine Learning Engineer with a strong background in data analysis, natural language processing, and machine learning. Holding a Bachelor of Science in Information Technology from Sikkim Manipal University, he excels in leveraging cutting-edge technologies such as Large Language Models (LLMs), TensorFlow, PyTorch, and Hugging Face to develop innovative solutions.

    View all posts
Spread the knowledge
 
  

Join the Discussion

Your email will remain private. Fields with * are required.