Can I Get Rid Of This 'b' Character In My Print Statement?
I'm wondering what this b charcter is and why it's appearing. I'm also wondering if I can get rid of it while printing the array? Here's my example: arr1 = np.array(['1', '2'], dty
Solution 1:
It means byte literal:
https://docs.python.org/2/whatsnew/2.6.html?highlight=string%20byte%20literal#pep-3112-byte-literals
As to getting rid of it you might try outputting as string rather than as an array object
for example:
s="["for x in arr1:
s += x.decode('utf-8')
s+= "]"print ("array: ", s , " and it's dtype is: ", arr1.dtype");
Post a Comment for "Can I Get Rid Of This 'b' Character In My Print Statement?"