Python 81 Flashcards Advanced 100% Free

Deep Learning::Numpy in Machine Learning

Created by Chat Robotics Community  ·  Updated 2025-07-19

Curriculum Overview

Topics & Key Concepts

Numpy Deep Learning Machine Learning Programming Python

Sample Flashcard Questions & Answers

Showing 8 of 81 cards
Question #1 Active Recall

What is NumPy?

Answer & Explanation:
NumPy is a Python library used for numerical computing that provides support for arrays and matrices, along with a collection of mathematical functions to operate on these data structures.
Question #2 Active Recall

What is a NumPy array?

Answer & Explanation:
A NumPy array is a grid of values, all of the same type, and is indexed by a tuple of nonnegative integers.
Question #3 Active Recall

How do you create a 2-dimensional NumPy array?

Answer & Explanation:
You can create a 2D NumPy array using `numpy.array([[1, 2], [3, 4]])`.
Question #4 Active Recall

What is the purpose of the `reshape` method in NumPy?

Answer & Explanation:
The `reshape` method changes the shape of an array without changing its data.
Question #5 Active Recall

How do you access elements in a NumPy array?

Answer & Explanation:
You access elements in a NumPy array using indexing, e.g., `array[0]` for the first element.
Question #6 Active Recall

What does `numpy.zeros` do?

Answer & Explanation:
`numpy.zeros` creates an array filled with zeros, given the shape specified.
Question #7 Active Recall

What does `numpy.ones` do?

Answer & Explanation:
`numpy.ones` creates an array filled with ones, given the shape specified.
```
shape = (3, 4) # 3 rows and 4 columns
ones_array = np.ones(shape)
```
Question #8 Active Recall

What is broadcasting in NumPy?

Answer & Explanation:
Broadcasting refers to how NumPy handles arithmetic operations on arrays of different shapes.

```
import numpy as np

# Create a 2D array and a 1D array
array_2d = np.array([[1, 2, 3],
[4, 5, 6]]) # Shape: (2, 3)
array_1d = np.array([10, 20, 30]) # Shape: (3,)

# Broadcasting the 1D array across each row of the 2D array
result = array_2d + array_1d

print("2D array shape:", array_2d.shape)
print("1D array shape:", array_1d.shape)
print("Result shape:", result.shape)
print("\n2D array:")
print(array_2d)
print("\n1D array:")
print(array_1d)
print("\nResult after broadcasting:")
print(result)
```
## Output
```
2D array shape: (2, 3)
1D array shape: (3,)
Result shape: (2, 3)

2D array:
[[1 2 3]
[4 5 6]]

1D array:
[10 20 30]

Result after broadcasting:
[[11 22 33]
[14 25 36]]
```

Want to study all 81 flashcards with spaced repetition?

Practice with Anki-style scheduling, Hands-Free audio commute mode, and AI Tutor explanations.

Start Studying Full Deck Now

How You Can Study This Deck on Chat Robotics

Anki Spaced Repetition (SRS)

Algorithms schedule review intervals automatically so you retain 90%+ in minimum study time.

Hands-Free Audio Commute Mode

High-fidelity Neural Text-To-Speech reads questions and answers aloud with customizable delay timers.

Built-in AI Tutor Assistant

Stuck on a tricky concept? Click "Ask AI" on any card to receive instant deep-dive step-by-step explanations.

Subdeck & Tag Organization

Organize and filter by topic tags or drill entire subdeck hierarchies sequentially in Subdeck Scheduler.