Turn NumPy Array of characters into a string
问题 I have a numpy array of characters and when I write it to file it writes as: ['K' 'R' 'K' 'P' 'T' 'T' 'K' 'T' 'K' 'R' 'G' 'L'] I want it to write with just the letters and without the brackets or quotations i.e. as: KRKPTTKTKRGL I have looked at numpy documentation and from what I have gathered the solution is a chararray however it looks like this is not as functional as a normal array. Any help would be great. Thanks! 回答1: You can use tostring() method of numpy as: >>> st = np.array(['K' 'R