Numpy reads txt as array in one line

vec = np.genfromtxt( ' wiki.ch.text.vector ' , skip_header=1, delimiter= '  ' , dtype=None) 
skip_header=1 is to skip the first line
delimiter is the field separator
because there are str and float in txt , so you need to set dtype=None, only float is read by default, so an error will be reported

Specifically transferred from https://blog.csdn.net/u010025211/article/details/51498790

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325291995&siteId=291194637