Count number of values in a nested dictionary
0
0
Entering edit mode
2.9 years ago
Rajavee ▴ 10

I have list with nested dictionaries in it

 [{'conserved': False,
  'id': ['lcl|Query_10002/1-436',
   'lcl|Query_10003/1-463',
   'lcl|Query_10004/1-437',
   'lcl|Query_10047/1-437',
   'lcl|Query_10048/1-437',
   'lcl|Query_10049/1-437',
   'lcl|Query_10010/1-439',]},
 {'conserved': True,
  'id': ['lcl|Query_10001/1-490',
   'lcl|Query_10005/1-460',
   'lcl|Query_10006/1-460',
   'lcl|Query_10007/1-460',
   'lcl|Query_10008/1-460',
   'lcl|Query_10009/1-460',
   'lcl|Query_10022/1-458',']}]

I wanted to count the number of id's for the false and true occurances. I was just wondering if there is a quick function to do this

Values Nested Dictionary • 708 views
ADD COMMENT
0
Entering edit mode

This is actually more of a python question rather than bioinformatics, so you might be better off asking this in a place like Stack overflow. In any case, what have you tried so far?

ADD REPLY

Login before adding your answer.

Traffic: 2650 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6