Skip to content

Python For Data Science

Master Python For Data Science with 100 free flashcards. Study using spaced repetition and focus mode for effective learning in Data Science.

🎓 100 cards ⏱️ ~50 min Advanced
Study Full Deck →
Share: 𝕏 Twitter LinkedIn WhatsApp

🎯 What You'll Learn

Preview Questions

12 shown

What function creates a NumPy array from a Python list?

Show ▼

np.array([1, 2, 3]) converts a Python list into a NumPy ndarray.

How do you create a 1D array of zeros with 5 elements in NumPy?

Show ▼

np.zeros(5) returns array([0., 0., 0., 0., 0.]).

How do you create a 3x3 identity matrix in NumPy?

Show ▼

np.eye(3) returns a 3×3 array with ones on the diagonal and zeros elsewhere.

What does <code>np.arange(0, 10, 2)</code> return?

Show ▼

It returns array([0, 2, 4, 6, 8]) — values from 0 up to (not including) 10 with step 2.

How do you generate 5 evenly spaced values between 0 and 1 in NumPy?

Show ▼

np.linspace(0, 1, 5) returns array([0., 0.25, 0.5, 0.75, 1.]).

How do you access the element at row 1, column 2 of a 2D NumPy array <code>arr</code>?

Show ▼

arr[1, 2] uses zero-based indexing to retrieve the element at the second row, third column.

What does <code>arr[:, 0]</code> select from a 2D NumPy array?

Show ▼

It selects all rows of the first column, returning a 1D array.

How do you slice rows 1 through 3 (inclusive) from a NumPy array?

Show ▼

arr[1:4] selects rows at indices 1, 2, and 3 (the stop index is exclusive).

What is broadcasting in NumPy?

Show ▼

Broadcasting is NumPy's ability to perform element-wise operations on arrays of different shapes by automatically expanding the smaller array to match dimensions.

Give an example of NumPy broadcasting with a scalar.

Show ▼

arr * 3 multiplies every element of arr by 3 without an explicit loop — the scalar is broadcast across the array.

How do you reshape a 1D array of 12 elements into a 3x4 matrix?

Show ▼

arr.reshape(3, 4) returns a 3×4 view of the array (total elements must match).

What does <code>arr.ravel()</code> do?

Show ▼

It flattens a multi-dimensional array into a 1D array, returning a view when possible.

🎓 Start studying Python For Data Science

🎮 Study Modes Available

🔄

Flashcards

Flip to reveal

🧠

Focus Mode

Spaced repetition

Multiple Choice

Test your knowledge

⌨️

Type Answer

Active recall

📚

Learn Mode

Multi-round mastery

🎯

Match Game

Memory challenge

📖 Learning Resources