Convert a repetitive list into Pandas Dataframe How do you convert something like this:

A: 1
B: 2
C: 3
###
A: 5
B: 5
C: 6
###
A: 2
B: 5
C: 7


into a dataset where the first row would be the first section with 


  A as column-1 B as column-2 and C as column-3


so we get this:

 A B C
 1 2 3
 5 5 6
 2 5 7
If I understand this correctly your sequence is always 3 elements. Then you can do this:

a = ['A:1','B:2','C:3','A:5','B:5','C:6','A:2','B:5','C:7']
b = []
rep_len = 3

# Looping with step size equal to repetition length
for i in range(0,len(a),rep_len):

    # Selecting a repetition length
    c = a[i:i+rep_len]

    # Extracting everything in after letter and colon and casting to integer
    c = [int(x[2:]) for x in c]

    # Append to a list of lists
    b.append(c)

df = pd.DataFrame(b, columns=['A', 'B', 'C'])


Resulting in:

    A   B   C
0   1   2   3
1   5   5   6
2   2   5   7