集合中的记录格式如下:
{"ID":"0001",
"Fir":"0",
"Sec":"1",
"FirCard_NE":["0402003","0101002","0201001","0503001","0402003","0204001","0204002","0301001","0101001","0402003","0501001","0501002","0503001","0503002","0501002"],
"SecCard_NE":["0101001","0101001","0201001","0202001","0203001","0204001","0204002","0301001","0301004","0204001","0501001","0501002","0503001","0503002","0301004"]
}
现在想统计在"Fir"为"0"的情况下,FirCard_NE字段中某个数组元素在整个集合中出现的次数(如统计在"Fir"为"0"的情况下,FirCard_NE中出现"0402003"的总次数)
`if d['Fir'] == '0':
print(d['FirCard_NE'].count('0402003'))`
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。