0

I ma using python 3.8 CODE:

import numpy as np 
s = 'Hello World' 
a = np.frombuffer(s, dtype = 'S1') 
print (a)

ERROR:

a = np.frombuffer(s, dtype = 'S1')

TypeError: a bytes-like object is required, not 'str'

0 Answers0