I have the following list:
x=['2 5 6 7', '9 11 13 15', '31 52 56 94']
My ultimate goal is to display it as table with columns and rows in jupyter notebook.
This is what I have done so far:
I converted the list into list of lists and now I have list looking like this:
x=[['2 5 6 7'], ['9 11 13 15'], ['31 52 56 94']]
The problem is that I am stuck how to split each string. For example I want to do get:
[['2' '5' '6' '7'], ['9' '11' '13' '15'], ['31' '52' '56' '94']]
so that I can use the following to print a table using pandas library
import pandas as pd
df = pd.DataFrame (x,columns=['int1','int2','int3','int4'])
print (df)
final output should look like this with columns names and row names
int1 int2 int3 int4
2 5 6 7
9 11 13 15
31 52 56 94
Please help me go in the right direction.