How do I create a numpy array from string?

前端 未结 3 1301
我在风中等你
我在风中等你 2021-02-08 11:53

I have a file reader that reads n bytes from a file and returns a string of chars representing that (binary) data. I want to read up n bytes into a numpy array

3条回答
  •  走了就别回头了
    2021-02-08 12:38

    Without knowing what you've got coming in it's tough, but if it were comma delimited integers you could do something like this:

    myInts = map(int, myString.split(','))
    

提交回复
热议问题