-2

The eutils package form NCBI returns the below object for a specific request. From this I want to extract the value 245540. How can I do that?

[{u'LinkSetDb'       : [{u'DbTo'     : 'sra',
                         u'Link'     : [{u'Id': '245540'}], 
                         u'LinkName' : 'biosample_sra'}],
  u'DbFrom'          : 'biosample', 
  u'IdList'          : ['1178400'], 
  u'LinkSetDbHistory': [],
  u'ERROR'           : []}]
ZF007
  • 3,708
  • 8
  • 29
  • 48
  • 1
    As best as I can understand it, you're asking how to [access values inside nested dictionaries](https://stackoverflow.com/questions/11700798/python-accessing-values-nested-within-dictionaries) which is a duplicate question. – Zooby Dec 01 '17 at 11:41

1 Answers1

1

if the variable name is var then var[0]['LinkSetDb'][0]['Link'][0]['Id']

Vivek
  • 341
  • 1
  • 5
  • 15