Lecture 1 - Numpy Basics Flashcards

1
Q

Conventional import of numpy?

A

import numpy as np

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

How to get the type of numpy array?

A

.dtype

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

How to get the shape of a numpy array?

A

.shape

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

Order of axes in numpy ndarrays?

A

rows then columns

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

Are numpy ndarrays 0-indexed?

A

yes

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

What is another name for the amount of dimensions an ndarray has?

A

its rank

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

What are some common dtypes?

A
  • float64
  • float32
  • int32
  • uint8
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How to load data into program using numpy?

A

np.loadtxt(file , delimeter = ‘’)

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