I have been searching on the forum and google, but I can't find a clear answer to my problem.
What I can find is how to read data from a file, but not from specific cells in Excel.
A small example of the input Excel file:
An/gene B An/gene C An/gene D An/gene E An/gene F An/gene G An/gene2 An/gene3 Nr B3 An/gene4 Nr B4 Nr C4 An/gene5 Nr B5 Nr C5 Nr D5 An/gene6 Nr B6 Nr C6 Nr D6 Nr E6 An/gene7 Nr B7 Nr C7 Nr D7 Nr E7 Nr F7 An/gene8 Nr B8 Nr C8 Nr D8 Nr E8 Nr F8 Nr G8
An/gene = animal and gene
Nr = number of identical scores
And the (raw) output should look like this:
An/gene2 An/gene B An/gene3 An/gene B Nr B3 An/gene4 An/gene B Nr B4 An/gene5 An/gene B Nr B5 An/gene6 An/gene B Nr B6 An/gene7 An/gene B Nr B7 An/gene8 An/gene B Nr B8 An/gene2 An/gene C An/gene3 An/gene C An/gene4 An/gene C Nr C4 An/gene5 An/gene C Nr C5 An/gene6 An/gene C Nr C6 An/gene7 An/gene C Nr C7 An/gene8 An/gene C Nr C8
The empty cells should be skipped of course.
Explanation of the input data:
I have a huge table with data that I want to print like the output file, to make it more clear what is happening. The data consist of a animal gene compared to a other animal gene. This comparison gives a identical score, that is what is printed in the third column of the output table.
So I would like to access cell by cell in a iteration, but in a structured way.
I know I can use a count function like + 1, but how do you tell Python to access for example cell B2?
An other option is to transform the data to a .csv file, but how do read then the file number by number in a specific order?
Can anyone give me some suggestions?
Edited 4 Years Ago by sinnebril: pasting files