I am trying to change this list
['AAAAA 4 2 1 2 4 2 4 4 5 2 2 1 5 2 4 3 1 1 3 3 5',
'BBB 5 2 1 2 4 5 4 4 1 2 2 2 4 4 4 3 1 2 3 3 2',
'K 4 1 2 1 2 1 2 5 1 1 1 1 4 2 2 1 5 1 3 4 1']
to something that looks like this
AAAAA -- [4, 2, 1, 2, 4, 2, 4, 4, 5, 2, 2, 1, 5, 2, 4, 3, 1, 1, 3, 3, 5]
BBB -- [5, 2, 1, 2, 4, 5, 4, 4, 1, 2, 2, 2, 4, 4, 4, 3, 1, 2, 3, 3, 2]
K -- [4, 1, 2, 1, 2, 1, 2, 5, 1, 1, 1, 1, 4, 2, 2, 1, 5, 1, 3, 4, 1]
i have tried multiple ways and cant figure it out
data['AAAAA'] = [4, 2, 1,...]str.splitorre.split? What have you already tried? What worked and what didn't? Stack Overflow is not a code-writing service. See How to Ask for tips.AAAAA,BBB,Kyou can useline[:5].strip()and rest you cansplit(' ')and convert to integers