--- tags: Python, Numpy --- # Python Numpy bytes np.array transfer ### np.array to bytes ```python zeros = np.zeros(shape=[1, 10]) data_bytes = zeros.tobytes() ``` ```python da = b'hello' # 一定要加 dtype data = np.frombuffer(da, dtype=np.uint8) ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up