How about this?
I assume that the numbers before a Timestamp are the ones belong to it:
This snippet also converts the numbers to integers.
CODE:
with open('source.txt', 'r') as f:
data = {}
numbers = []
for line in f:
ln = line.strip()
if 'Timestamp' in ln:
data[ln] = numbers
numbers = []
elif ln:
numbers.append([int(n) for n in ln.split()])
print(data)
OUTPUT:
{
'Timestamp 2':
[
[5, 4, 8, 9, 8, 7, 2],
[1, 5, 9, 6, 3, 1, 2]
],
'Timestamp 1':
[
[1, 2, 2, 3, 4, 5, 6],
[1, 5, 8, 9, 3, 4, 2],
[1, 2, 3, 5, 1, 2, 3]
]
}