what is the fastest way in python to convert a string with formatted numbers in an numpy array

前端 未结 2 1969
情深已故
情深已故 2021-01-22 08:17

I have a large ASCII file (~100GB) which consists of roughly 1.000.000 lines of known formatted numbers which I try to process with python. The file is too large to read in comp

2条回答
  •  北海茫月
    2021-01-22 08:20

    Have you tried numpyp.fromstring?

    np.fromstring(line, dtype=np.float, sep=" ")
    

提交回复
热议问题