numpy basic 1 Flashcards
data type, array creation func
1
Q
int8, uint8
A
i1, u1
2
Q
int16, uint16,
A
i2, u2
3
Q
int32, uint32
A
i4 , u4
4
Q
int64, uint64
A
i8, u8
5
Q
float16
A
f2
6
Q
float32
A
f4 or f
7
Q
float64
A
f8 or d
8
Q
float128
A
f16 or g
9
Q
complex64
A
c8 c16
10
Q
complex128
A
c32
11
Q
bool
A
?
12
Q
object
A
0
13
Q
string
A
S
14
Q
unicode
A
U
15
Q
array
Convert input data (list, tuple, array, or other sequence type) to an ndarray either by inferring a dtype
or explicitly specifying a dtype; copies the input data by default
A
In [19]: data1 = [6, 7.5, 8, 0, 1]
In [20]: arr1 = np.array(data1)
In [21]: arr1
Out[21]: array([ 6. , 7.5, 8. , 0. , 1. ])