I have an Excel spreadsheet (v14.4.1 for Mac) containing gene expression data in different conditions:
cond1 cond2 cond3
gene1 1.57 2.52 12.05
gene2 0.01 8.90 31.20
gene3 57.05 12.14 50.76
...
(i.e., the first row and the first column of the spreadsheet contain the condition names and gene names, respectively)
I would like to read this Excel sheet into a python dictionary whose keys are tuples containing the gene and condition names:
myDict[('gene1','cond1')] = 1.57
myDict[('gene1','cond2')] = 2.52
myDict[('gene1','cond3')] = 12.05
myDict[('gene2','cond1')] = 0.01
...
It think I need to use cvs.DictReader (after saving the spreadsheet as a cvs file), but, I am not sure how to do this.
What do you plan to do with the data once it has been read and stored? Just asking to ascertain that you're using Python for the right reasons.
I am doing some custom analysis using optimization solvers.