I have the following data frame and want to extract the floats in the cells and perform calculations (in this case multiplications) and put them back into a new data frame (first row p000_1-p000_10, second row p100_1-p100_10). Is there a way to do this a simpler way instead of one after the other like I did? Here is what I did so far:
prob_all = {'prob_1': {1.0: 0.03409090909090909,
2.0: 0.022727272727272728,
3.0: 0.045454545454545456,
4.0: 0.5340909090909091,
5.0: 0.06818181818181818,
6.0: 0.011363636363636364,
7.0: 0.13636363636363635,
8.0: 0.06818181818181818,
9.0: 0.045454545454545456,
10.0: 0.03409090909090909},
'prob_2': {1.0: 0.045454545454545456,
2.0: 0.011363636363636364,
3.0: 0.03409090909090909,
4.0: 0.4659090909090909,
5.0: 0.11363636363636363,
6.0: 0.045454545454545456,
7.0: 0.1590909090909091,
8.0: 0.045454545454545456,
9.0: 0.03409090909090909,
10.0: 0.045454545454545456},
'prob_3': {1.0: 0.1111111111111111,
2.0: nan,
3.0: 0.06349206349206349,
4.0: 0.3968253968253968,
5.0: 0.07936507936507936,
6.0: nan,
7.0: 0.19047619047619047,
8.0: 0.1111111111111111,
9.0: nan,
10.0: 0.047619047619047616},
'prob_4': {1.0: nan,
2.0: nan,
3.0: 0.043478260869565216,
4.0: 0.391304347826087,
5.0: 0.13043478260869565,
6.0: nan,
7.0: 0.08695652173913043,
8.0: 0.2608695652173913,
9.0: nan,
10.0: 0.08695652173913043}}
prob_all = pd.DataFrame.from_dict(prob_all)
p000_1 = prob_all.iat[0,0]
p000_2 = prob_all.iat[1,0]
p000_3 = prob_all.iat[2,0]
p000_4 = prob_all.iat[3,0]
p000_5 = prob_all.iat[4,0]
p000_6 = prob_all.iat[5,0]
p000_7 = prob_all.iat[6,0]
p000_8 = prob_all.iat[7,0]
p000_9 = prob_all.iat[8,0]
p000_10 = prob_all.iat[9,0]
p100_1 = p000_1*prob_all.iat[0,1]
p100_2 = p000_1*prob_all.iat[1,1]
p100_3 = p000_1*prob_all.iat[2,1]
p100_4 = p000_1*prob_all.iat[3,1]
p100_5 = p000_1*prob_all.iat[4,1]
p100_6 = p000_1*prob_all.iat[5,1]
p100_7 = p000_1*prob_all.iat[6,1]
p100_8 = p000_1*prob_all.iat[7,1]
p100_9 = p000_1*prob_all.iat[8,1]
p100_10 = p000_1*prob_all.iat[9,1]
p200_1 = p000_2*prob_all.iat[0,1]
p200_2 = p000_2*prob_all.iat[1,1]
p200_3 = p000_2*prob_all.iat[2,1]
p200_4 = p000_2*prob_all.iat[3,1]
p200_5 = p000_2*prob_all.iat[4,1]
p200_6 = p000_2*prob_all.iat[5,1]
p200_7 = p000_2*prob_all.iat[6,1]
p200_8 = p000_2*prob_all.iat[7,1]
p200_9 = p000_2*prob_all.iat[8,1]
p200_10 = p000_2*prob_all.iat[9,1]
p300_1 = p000_3*prob_all.iat[0,1]
p300_2 = p000_3*prob_all.iat[1,1]
p300_3 = p000_3*prob_all.iat[2,1]
p300_4 = p000_3*prob_all.iat[3,1]
p300_5 = p000_3*prob_all.iat[4,1]
p300_6 = p000_3*prob_all.iat[5,1]
p300_7 = p000_3*prob_all.iat[6,1]
p300_8 = p000_3*prob_all.iat[7,1]
p300_9 = p000_3*prob_all.iat[8,1]
p300_10 = p000_3*prob_all.iat[9,1]
p110_1 = p100_1*prob_all.iat[0,2]
p110_2 = p100_1*prob_all.iat[1,2]
p110_3 = p100_1*prob_all.iat[2,2]
p110_4 = p100_1*prob_all.iat[3,2]
p110_5 = p100_1*prob_all.iat[4,2]
p110_6 = p100_1*prob_all.iat[5,2]
p110_7 = p100_1*prob_all.iat[6,2]
p110_8 = p100_1*prob_all.iat[7,2]
p110_9 = p100_1*prob_all.iat[8,2]
p110_10 = p100_1*prob_all.iat[9,2]
p120_1 = p100_2*prob_all.iat[0,2]
p120_2 = p100_2*prob_all.iat[1,2]
p120_3 = p100_2*prob_all.iat[2,2]
p120_4 = p100_2*prob_all.iat[3,2]
p120_5 = p100_2*prob_all.iat[4,2]
p120_6 = p100_2*prob_all.iat[5,2]
p120_7 = p100_2*prob_all.iat[6,2]
p120_8 = p100_2*prob_all.iat[7,2]
p120_9 = p100_2*prob_all.iat[8,2]
p120_10 = p100_2*prob_all.iat[9,2]
p130_1 = p100_3*prob_all.iat[0,2]
p130_2 = p100_3*prob_all.iat[1,2]
p130_3 = p100_3*prob_all.iat[2,2]
p130_4 = p100_3*prob_all.iat[3,2]
p130_5 = p100_3*prob_all.iat[4,2]
p130_6 = p100_3*prob_all.iat[5,2]
p130_7 = p100_3*prob_all.iat[6,2]
p130_8 = p100_3*prob_all.iat[7,2]
p130_9 = p100_3*prob_all.iat[8,2]
p130_10 = p100_3*prob_all.iat[9,2]
p210_1 = p200_1*prob_all.iat[0,2]
p210_2 = p200_1*prob_all.iat[1,2]
p210_3 = p200_1*prob_all.iat[2,2]
p210_4 = p200_1*prob_all.iat[3,2]
p210_5 = p200_1*prob_all.iat[4,2]
p210_6 = p200_1*prob_all.iat[5,2]
p210_7 = p200_1*prob_all.iat[6,2]
p210_8 = p200_1*prob_all.iat[7,2]
p210_9 = p200_1*prob_all.iat[8,2]
p210_10 = p200_1*prob_all.iat[9,2]
#probability of third job being 1,2,3,4,5,6,7,8,9,10 - given 1st job was 2, 2nd job was 2 - 2-2-0
p220_1 = p200_2*prob_all.iat[0,2]
p220_2 = p200_2*prob_all.iat[1,2]
p220_3 = p200_2*prob_all.iat[2,2]
p220_4 = p200_2*prob_all.iat[3,2]
p220_5 = p200_2*prob_all.iat[4,2]
p220_6 = p200_2*prob_all.iat[5,2]
p220_7 = p200_2*prob_all.iat[6,2]
p220_8 = p200_2*prob_all.iat[7,2]
p220_9 = p200_2*prob_all.iat[8,2]
p220_10 = p200_2*prob_all.iat[9,2]
#probability of third job being 1,2,3,4,5,6,7,8,9,10 - given 1st job was 2, 2nd job was 3 - 2-3-0
p230_1 = p200_3*prob_all.iat[0,2]
p230_2 = p200_3*prob_all.iat[1,2]
p230_3 = p200_3*prob_all.iat[2,2]
p230_4 = p200_3*prob_all.iat[3,2]
p230_5 = p200_3*prob_all.iat[4,2]
p230_6 = p200_3*prob_all.iat[5,2]
p230_7 = p200_3*prob_all.iat[6,2]
p230_8 = p200_3*prob_all.iat[7,2]
p230_9 = p200_3*prob_all.iat[8,2]
p230_10 = p200_3*prob_all.iat[9,2]
p000 = [p000_1,p000_2,p000_3,p000_4,p000_5,p000_6,p000_7,p000_8,p000_9,p000_10]
p100 = [p100_1, p100_2, p100_3, p100_4, p100_5, p100_6, p100_7, p100_8, p100_9, p100_10]
p200 = [p200_1, p200_2, p200_3, p200_4, p200_5, p200_6, p200_7, p200_8, p200_9, p200_10]
p300 = [p300_1, p300_2, p300_3, p300_4, p300_5, p300_6, p300_7, p300_8, p300_9, p300_10]
p110 = [p110_1, p110_2, p110_3, p110_4, p110_5, p110_6, p110_7, p110_8, p110_9, p110_10]
p120 = [p120_1, p120_2, p120_3, p120_4, p120_5, p120_6, p120_7, p120_8, p120_9, p120_10]
p130 = [p130_1, p130_2, p130_3, p130_4, p130_5, p130_6, p130_7, p130_8, p130_9, p130_10]
p210 = [p210_1, p210_2, p210_3, p210_4, p210_5, p210_6, p210_7, p210_8, p210_9, p210_10]
p220 = [p220_1, p220_2, p220_3, p220_4, p220_5, p220_6, p220_7, p220_8, p220_9, p220_10]
p230 = [p230_1, p230_2, p230_3, p230_4, p230_5, p230_6, p230_7, p230_8, p230_9, p230_10]
df = pd.DataFrame.from_records([p000,p100, p200, p300, p110, p120, p130, p210, p220, p230])
iatis used for dataframe not for dictionaries. Please edit your question and make it more clear