NumPy Essentials
77 cards · 🇺🇸 English
Array creation, indexing, broadcasting, and core NumPy operations.
Study all 77 cards for free
Flashcards, quizzes, pixel-art games and a daily review that remembers for you.
Try the first 10 cards
1 / 10NumPy
Tap the card for the answer · swipe right if you knew it, left if not
Already have an account? Sign in
Cards
- 1NumPyA library for Python that adds support for large, multi-dimensional arrays and matrices with high-level mathematical functions
- 2NumPy import conventionimport numpy as np
- 3NdarrayNumPy's n-dimensional array data structure - a homogeneously typed array
- 4Homogeneously typedAll elements of a NumPy array must be of the same type
- 5Create a 1D NumPy arraynp.array([1, 2, 3, 4])
- 6Create a 2D NumPy arraynp.array([[1, 2], [3, 4]])
- 7a list vs a NumPy arrayNumPy arrays are homogeneous, fixed-size, and optimized for numerical operations; lists are heterogeneous and dynamic
- 8Np.zeros()Creates an array filled with zeros of a specified shape
- 9Np.ones()Creates an array filled with ones of a specified shape
- 10Np.arange()Creates an array with evenly spaced values within a given interval (like Python's range)
- 11Np.linspace()Creates an array with a specified number of evenly spaced values between start and end
- 12np.arange() vs np.linspace()arange uses step size; linspace specifies number of points
- 13Array.shapeA tuple representing the dimensions of the array
- 14Array.sizeThe total number of elements in the array
- 15Array.ndimThe number of dimensions (axes) of the array
- 16Array.dtypeThe data type of the array elements
- 17Change the shape of an arrayUse np.reshape() or array.reshape()
- 18Array.flatten()Returns a 1D copy of the array
- 19Array.ravel()Returns a flattened array (may return a view, not always a copy)
- 20Vectorization in NumPyPerforming operations on entire arrays without explicit loops (much faster than Python loops)
- 21Can you add two NumPy arrays?Yes, element-wise: a + b
- 22What happens when you multiply two NumPy arrays?Element-wise multiplication (not matrix multiplication)
- 23Perform matrix multiplicationUse np.dot(a, b) or a @ b (Python 3.5+)
- 24Universal functions (ufuncs)Functions that operate element-wise on arrays (e.g., np.sin, np.exp, np.sqrt)
- 25Np.sin()Computes the sine of each element in the array
- 26Np.exp()Computes e^x for each element in the array
- 27Np.sqrt()Computes the square root of each element in the array
- 28Np.sum()Returns the sum of all elements (or along a specified axis)
- 29Np.mean()Returns the arithmetic mean (average)
- 30Np.std()Returns the standard deviation
And 47 more cards. Study the whole deck free
Articles about this deck
More Programming decks
See all- 🐼
Pandas Essentials
93 cards · 🇺🇸 English
DataFrames, Series, and core Pandas data manipulation operations.
- 📊
Data Visualization
41 cards · 🇺🇸 English
Chart types, plotting libraries, and data visualization best practices.
- 🤖
Machine Learning: Algorithms & Metrics
75 cards · 🇺🇸 English
Core ML algorithms and the metrics used to evaluate them.
- 🧠
Deep Learning
66 cards · 🇺🇸 English
Neural network architectures, training concepts, and deep learning terminology.
- 🧱
Data Structures
95 cards · 🇺🇸 English
Arrays, linked lists, trees, graphs, hash tables and their core operations.
- 🟣
C#: Fundamentals & .NET Core
99 cards · 🇺🇸 English
Core C# syntax, types, and .NET Core concepts in one deck.
