Sandhya Govindaraju - Introduction to Numerical Computing With NumPy | SciPy 2023

Introduction to Numerical Computing with NumPy, covering vectorization, indexing, slicing, boolean indexing, array operations, reshaping, broadcasting, error handling, and more, with a focus on practical applications and avoiding common pitfalls.

Key takeaways
  • Pay attention to the details: Sandhya Govindaraju emphasizes the importance of carefully checking the details when working with NumPy, as simple mistakes can lead to incorrect results.
  • Use NumPy’s vectorization: Vectorization is the process of applying an operation to each element of an array. NumPy provides several functions that can be used to perform vectorized operations, such as np.array, np.arange, and np.random.rand.
  • Indexing: NumPy uses 0-based indexing, which means that the first element of an array is at index 0.
  • Slicing: NumPy allows for slicing of arrays using the [] notation, which can be used to extract a subset of rows and columns.
  • Boolean indexing: Boolean indexing is a way to select specific rows and columns based on a condition.
  • Array operations: NumPy provides several array operations, including addition, subtraction, multiplication, and division.
  • Reshaping: NumPy’s reshape function can be used to change the shape of an array.
  • Broadcasting: NumPy’s broadcasting is a way to combine arrays of different shapes using the + operator.
  • getID and compression: NumPy provides functions for reading and writing ID and compression formats such as .txt and .npy.
  • Error handling: NumPy provides several error handling mechanisms, such as trying to load the array in reads from the file and writing the array to a file.
  • Practice and familiarity: Sandhya Govindaraju emphasizes the importance of practicing with NumPy and becoming familiar with its functions and operations.