回答此问题可获得 20 贡献值,回答如果被采纳可获得 50 分。
<p>我不熟悉python,但仍然尝试在internet上搜索解决方案。但没有找到任何解决办法。以下是我要整理的数据:</p>
<pre><code>{'Items': [
{'event': 'active', 'options.target': 'items', 'meta.timestamp': 1584826254819, 'id': 'foo111', 'userId': '1a938ea1-c65e-641a-5db5-5e56c7d8e90b', 'properties.new': 'ABC123'
},
{'event': 'active', 'options.target': 'previousTop', 'meta.timestamp': 1584820823598, 'id': 'foo111', 'userId': '1a938ea1-c65e-641a-5db5-5e56c7d8e90b', 'properties.new': 'KUCC00302'
},
{'_.from': 'engineEnd', '_.called': 'track', 'event': 'active', 'traits.id': 'foo333', 'options.target': 'items', 'properties.old': 'ABC123', 'meta.timestamp': 1584826518511, 'partner_resid': 'r-1a938ea1-c65e-641a-5db5-5e56c7d8e90b', 'id': 'foo111', 'userId': '1a938ea1-c65e-641a-5db5-5e56c7d8e90b', 'properties.new': 'ABC111', 'id': 'dc3775e0-6bbb-11ea-a789-4f693944a864', 'anonymousId': '3bd5eda3-8625-4b54-b02b-e24f78011ca7', '_.originalAction': 'track', 'type': 'track'}
}
</code></pre>
<p>我想修剪具有键的dict<strong>properties.old</strong>
以下是我未能筛选的代码:</p>
<pre><code>for item in json_result['Items']:
if 'properties.old' in item:
del item
</code></pre>
<p>对我做错了什么有什么建议吗</p>