NumPy char encode

NumPy char encode

NumPy char encode. This function calls str.encode function for each element in the array. Default encoding is utf_8, codecs available in standard Python library may be used.

import numpy as np 
a = np.char.encode('hello', 'cp500') 
print a

Its output is as follows −

�����

Next Topic – Click Here

This Post Has 2 Comments

Leave a Reply