NumPy Arrays and Syntax

0.0(0)
Studied by 2 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/36

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 9:40 AM on 9/27/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

37 Terms

1
New cards

Creates array from list

np.array([1, 2, 3])


2
New cards

Creates evenly spaced array

np.arrange(start, stop, step)


3
New cards

Creates evenly spaced array

np.linspace(start, stop, number_of_elements)


4
New cards

Creates array of 0s

np.zeros(number_of_0)


5
New cards

Creates array of 1s

np.ones(number_of_1)


6
New cards

Creates array of specific value

np.full(shape, fill_value)


7
New cards

Creates identity matrix

np.eye(size)


8
New cards

Creates uniform distribution [0, 1)

np.random.rand(number_of_terms)


9
New cards

Creates random array

np.random.ranint(min, max, size=x)


10
New cards

Addition

a + b


11
New cards

Subtraction

a - b


12
New cards

Element-wise multiplication

a * b


13
New cards

Matrix multiplication

a % b


14
New cards

Division

a / b


15
New cards

Square root

np.sqrt(a)


16
New cards

Scalar addition

a + 10


17
New cards

Scalar multiplication

a * 2


18
New cards

Scalar power

a ** 3


19
New cards

Element comparisons

a > 2, a == 3, a <= 4


20
New cards

Reshapes to n x m array

[array].reshape(n, m)


21
New cards

Converts to 1D

[array].flatten()


22
New cards

Reshapes to n rows

[array].reshape(n, -1)


23
New cards

Transpose array

[array].T


24
New cards

Vertical concatenation

np.vstack([array1], [array2])


25
New cards

Horizontal concatenation

np.hstack([array1], [array2])


26
New cards

Sum

np.sum([array])


27
New cards

Mean

np.mean([array])


28
New cards

Median

np.median([array])


29
New cards

Standard deviation

np.std([array])


30
New cards

Variance (range)

np.var([array])


31
New cards

Minimum value

np.min([array])


32
New cards

Maximum value

np.max([array])


33
New cards

Rows

axis=0


34
New cards

Columns

axis=1


35
New cards

Sorts array

np.sort([array])


36
New cards

Keeps only unique values

np.unique([array])


37
New cards

Searches for specific values

np.where([condition])