Conteúdo do Curso
Getting into NumPy Basics
Swipe to show menu
Manipulating and Indexing
Manipulating and indexing NumPy
arrays involve altering and retrieving the elements of a NumPy
array. NumPy
stands as a potent library for handling large, multi-dimensional arrays and matrices of numerical data in Python.
It offers an array of functions and methods for manipulating and indexing arrays, including techniques to extract specific rows, columns, or elements, alter an array's shape, transpose arrays, and convert arrays into a 1D vector.
Swipe to show code editor
- Create a random 4x4 array filled with random integers ranging from 0 to 10.
- Extract the second row.
- Extract the second column.
- Replace the second column of the array with a new column of all ones.
Obrigado pelo seu feedback!