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

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

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

StringGrid issue in Delphi XE8 firemonkey mobile app -