Closed ressy closed 5 years ago
This is the DictReader class I mentioned: https://docs.python.org/3/library/csv.html#csv.DictReader (It defaults to taking the first row as the keys so it's a bit like read.table with header=TRUE but as a list of dicts instead of a data frame.)
I think this is a good solution, I was wondering if it would also work with TSV files, and apparently it does. I want to read up on it more though.
I found another solutions using the replace('"', '') function on strings. Got rid of all the quotes and implemented it into the current definition I was using.
Updates in #53.
If my sampleInfo table has quoted fields (like R likes to make with write.csv for example) import_sample_info sees the quotes as part of the text and can't find the sampleName column:
The built-in csv module could help handle those sorts of formatting things automatically.