https://numpy.org/doc/stable/reference/arrays.scalars.html
https://numpy.org/doc/stable/reference/arrays.dtypes.html#arrays-dtypes-constructing
Typy całkowitoliczbowe |
int ,int8 ,int16 ,int32 ,int64 |
Typy całkowitoliczbowe (bez znaku) |
uint ,uint8 ,uint16 ,uint32 ,uint64 |
Typ logiczny |
bool |
Typy zmiennoprzecinkowe |
float , float16 , float32 , float64 , float128 |
Typy zmiennoprzecinkowe zespolone |
complex , complex64 , complex128 , complex256 |
Napis |
str |
import numpy as np
tab = np.array([[2, -3], [4, -8]])
print(tab)
tab2 = np.array([[2, -3], [4, -8]], dtype=int)
print(tab2)
tab3 = np.array([[2, -3], [4, -8]], dtype=float)
print(tab3)
tab4 = np.array([[2, -3], [4, -8]], dtype=complex)
print(tab4)
[[ 2 -3]
[ 4 -8]]
[[ 2 -3]
[ 4 -8]]
[[ 2. -3.]
[ 4. -8.]]
[[ 2.+0.j -3.+0.j]
[ 4.+0.j -8.+0.j]]