I have an excel table that i read in by data = pd.read_excel('..data.xlsx')
Block Concentration Name Replicate Value
1 100 A 1 1446
1 100 A 2 25
1 100 A 3 12
1 33 A 1 111
1 33 A 2 222
1 33 A 3 1234
...
1 0 C 3 86
..
2 100 A 1 634
2 100 A 2 93
2 100 A 3 287
2 33 A 1 97234
2 33 A 2 1222
2 33 A 3 456
...
2 0 D 3 9800
...
...
24 0 E 3 93948
There are 24 blocks, 4 types of concentrations and many names. There are three replicates for each 'Block|Concentration|Name' combo, which points to unique 'Value' numbers.
I created a dictionary 'd' with hashes of :
hash{Block|Concentration|Name|Replicate} -> value
pseudo code:
for block 1-> 24:
for each concentration:
print (concentration)
for each name:
for replicate 1-> 3:
print key of hash{Block|Concentration|Name|Replicate}
my code:
for b in data.Block:
for c in data.Concentration:
print(c)
for n in data.Name:
for r in data.Replicate:
print(d)
the result is a mess, i think it's printing out everything for each loop.
the output structure i have in mind (output doesn't need to be in the format):
Block1
Concentration Name A Name B Name C..
100 1446 25 12 .. .. .. ...
33 111 222 1234 .. .. ..
10 .. .. .. ..
0 .. .. .. ..
Block2
Concentration Name A Name B Name C..
100 634 93 287 .. .. .. ...
33 97234 1222 456 .. .. ..
10 .. .. .. ..
0 .. .. .. ..
..
..
..
Block 24 ...