python - Create a dictionary/list from a CSV file -


i have sheet , want group dictionary. imported , in comma-separated format

accession,a,b,o,k,g,f 3364,+,-,+,-,+,- 3365,-+,-,+,-,+,-  3366,+,-,-,-,+,+   

i want put this:

{'3364': {'a': '+', 'b': '-', 'o': '+','k': '-', 'g': '+', 'f': '-'}} 

how can that?

jon right, here hint:

d = {} = '3364,+,-,+,-,+,-' n, *pm = a.split(',') d[n] = {chr(i+65): v i, v in enumerate(pm)} print(d) 

Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -