kopia lustrzana https://github.com/animator/learn-python
Example for unsigned integer type is added
rodzic
0f4cf64fb0
commit
c64b262eda
|
@ -65,6 +65,7 @@ Way 2: Using `dtype()`
|
|||
# Output: int32
|
||||
```
|
||||
|
||||
Note: `np.intc()` has the same function as `int32()`.
|
||||
## Example for float type
|
||||
|
||||
Way 1: Using function `float_()`
|
||||
|
@ -101,8 +102,32 @@ Note: `np.single()` has the same function as `float32()`.
|
|||
|
||||
## Example for boolean type
|
||||
|
||||
``` python
|
||||
import numpy as np
|
||||
|
||||
x = np.bool_(1)
|
||||
|
||||
print(x)
|
||||
print(x.dtype)
|
||||
|
||||
# Output:
|
||||
# True
|
||||
# bool
|
||||
```
|
||||
## Example for unsigned integer type
|
||||
|
||||
``` python
|
||||
import numpy as np
|
||||
|
||||
x = np.uintc(1)
|
||||
|
||||
print(x)
|
||||
print(x.dtype)
|
||||
|
||||
# Output:
|
||||
# 1
|
||||
# uint32
|
||||
```
|
||||
## Example for complex type
|
||||
|
||||
## Example for datetime type
|
||||
|
|
Ładowanie…
Reference in New Issue