I've looked at other examples (like this for example Getting a map() to return a list in Python 3.x) and I haven't been able to figure it out. I'm trying to turn a list like this (it's about a thousand lines but I'm making it short for here)
xyz = [' 0.35587716 -2.11974747 -3.69604539',
' 0.32428861 -2.15566737 -3.61313426',
' 0.35329223 -2.19372613 -3.75673156']
Into either an array or list of floats like this
b = [[0.35587716, -2.11974747, -3.69604539],
[0.32428861, -2.15566737, -3.61313426],
[0.35329223, -2.19372613, -3.75673156]]
I have tried the following
b = np.array(map(lambda x: map(int, x.split()), xyz))
b = [[int(y) for y in x.split()] for x in xyz]
with open("file.log") as f:
lis=[map(int,line.split()) for line in f]
And all of these give me back something like:
<map object at 0x117a89390>
<map object at 0x117a89390>
<map object at 0x117a89390>
etc, etc.
But I don't know how to access the values in the map object. I'm using Python 3.6.0. I'm not sure what to do :(