I have a string of numbers that I would like to convert to a nested list. So far, I have
with open('lifedata.txt') as f:
table_data = [ line.split() for line in f]
print(table_data)
If the text document consists of numbers ordered like this,
0000000
0010000
0001000
0111000
0000000
0000000
The code I have so far only creates a nested list that looks like, [['0000000'], ['0010000'], ['0001000'], ['0111000'], ['0000000'], ['0000000']]
But instead, I wanted it took be [[0,0,0,0,0,0,0],[],[]] and so on. I also do not know how to convert the string into an integer. I'm just very confused on how I should manipulate the original text document to do what I want it to.