Entering edit mode
9 months ago
aj123
▴
120
There seems to be something wrong with the code below; im not sure if it is the indentations because im getting a different result each time if i change the indents; I'm not sure which is the correct way to indent.
fh = open("df_1.csv")
readr = csv.reader(fh)
header = next(readr)
header
data = [row for row in readr]
names = set()
for row in data :
mapID = row[1]
for n in mapID :
names.add(n)
len(names)
This isn't really a bioinformatics question, but we can't really answer the question regardless without understanding what your input and desired output look likes.
im trying to get the number of genes (names). the desired output is a number. input is a csv file.
The number of unique gene names? And the names are in the second column of the CSV file?
yes that is correct
You can just do something like this then.