Numpy loading csv TOO slow compared to Matlab

前端 未结 5 1637
無奈伤痛
無奈伤痛 2020-12-01 05:08

I posted this question because I was wondering whether I did something terribly wrong to get this result.

I have a medium-size csv file and I tried to use numpy to l

5条回答
  •  感情败类
    2020-12-01 06:12

    Perhaps it's better to rig up a simple c code which converts the data to binary and have `numpy' read the binary file. I have a 20GB CSV file to read with the CSV data being a mixture of int, double, str. Numpy read-to-array of structs takes more than an hour, while dumping to binary took about 2 minutes and loading to numpy takes less than 2 seconds!

    My specific code, for example, is available here.

提交回复
热议问题