我有字典:
tmpDict = {
'original': ['Locate inner shroud bushes onto variable vanes.'],'operation': ['locate'],'target': ['inner shroud bushes'],'targetState': ['onto variable vanes'],'referenceToSpecification': [None],'relation': [None],'operationmanner': [None],'aim': [None]
}
,我想对其进行过滤以删除“无”值。因此得到这个:
{
'original': ['Locate inner shroud bushes onto variable vanes.'],}
我尝试过:
tempDict = {k: v for k,v in tempDict.items() if v != None}
还有一些运气不好。