I have a NumPy array which elements are strings. For example
import numpy as np
a = np.array(["abcde", "degag"])
I need to extract the first n characters from each element of the array (substr/strleft). The result for the first 3 characters should be an aray like this one:
array(['abc', 'deg'], dtype='<U3')
Thank you very much