I am new to pandas and I have a data frame that looks like this:
9861:1.0 9620:1.0 9865:1.0 30260:1.0 30026:1.0 10770:1.0
10772:1.0 10771:0.5 10774:0.5 10773:0.0 9750:1.0 9755:1.0
9632:1.0 30255:1.0 30012:1.0 30015:1.0 30251:1.0 11639:1.0
Looks like a dictionary, but entries are not ordered in columns. The string before the colon is an id and the one after is a score. I need a function to retrieve specific values for all rows. The outcome should be a new data frame that:
1) keeps the index per row (which doesn't show in the snippet but it's in my original data frame).
2)Creates columns the titles of which are the ids that I specify and the data in the cell is the score (let's say the column 9865 should contain the scores that currently are after "9865:")
Your help would be really amazing. Thank you.