Fastest way to generate delimited string from 1d numpy array

前端 未结 7 2220
春和景丽
春和景丽 2020-12-15 16:53

I have a program which needs to turn many large one-dimensional numpy arrays of floats into delimited strings. I am finding this operation quite slow relative to the mathema

7条回答
  •  心在旅途
    2020-12-15 17:33

    Using imap from itertools instead of map in the OP's code is giving me about a 2-3% improvement which isn't much, but something that might combine with other ideas to give more improvement.

    Personally, I think that if you want much better than this that you will have to use something like Cython.

提交回复
热议问题