Busy looking into the limits of loadtxt specifically. I have a multi-dimensional array:
# Sample header for python loadtxt
Very random text:¤mixed with¤strings¤numbers
300057¤9989¤34956¤1
110087¤9189¤24466¤4
# EOF
I can read this all in as a string (unknown length) and then convert to integers and floats later. This I have here:
import numpy as np
txtdata = np.loadtxt('Mytxtfile.txt',delimiter=chr(164),comments="#",dtype='str')
However I would like to know if it is possible to extract, directly into a multidimensional array. Such as:
>>>
[['Very random text:','mixed with','strings','numbers']
[300057,9989,34956,1]
[110087, 9189, 24466, 4]]
I tried this dtype command with no success:
dtype=[('a', 'str'),('b','int'),('c','int')]