Numpy Flashcards

1
Q

Numpy: Flip ndarray upside down

A

np.flipud(matrix)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Numpy: Transpose a ndarray

A

arr.T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Numpy: Flip ndarray left right

A

np.fliplr(matrix)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Numpy: Rotate ndarray by 90 degrees

A

np.rot90(matrix)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Numpy: View the numbers stored in the memory of a ndarray

A

np.ravel(arr)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Numpy: View the numbers stored in the memory of a ndarray using C or Fortran methods

A

np. ravel(order=”C”)

np. ravel(order=”F”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Numpy: Convert a ndarray to int32

A

arr.astype(“int32”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Numpy: Remove all singleton dimensions

A

np.squeeze(arr)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly