728x90
반응형
"""
# Python DataTypes
strings
: "Hello World"
integer
: -2, 0, 1, 2
float
: 1.2, 3.4
boolean
: True, False
complex
: 1.0 + 2.0j, 1.5 + 2.5j
"""
"""
# Numpy DataTypes
s : string
i : integer
b : boolean
u : unsigned integer
f : float
c : complex
m : timedelta
M : datetime
O : object
U : unicode string
V : void
"""
"""
# How to CHECK & CONVERT array datatypes for Numpy
import numpy as np
arr = np.array([1, 2, 3, 4])
print(arr.dtype) # int32
#-> Depend on system env / 32, 64
f_arr = arr.astype("f") #("float32")
print(f_arr.dtype)
"""
728x90
반응형
'Language > Python' 카테고리의 다른 글
[PySide] Hello World (0) | 2022.10.26 |
---|---|
To change the Python version & Interpreter for VSCODE (0) | 2022.09.08 |
Basic Python_ Class exam : FourCal_Sourcecode (0) | 2022.08.26 |
Jump to Python_Source code (0) | 2022.08.26 |
Python_11. Collection Management (0) | 2022.08.03 |