向Pandas DataFrame添加维度

时间:2016-09-21 18:49:41

标签: pandas dataframe

我正在迭代Pandas DataFrame对象for i, alert in mw_alerts.iterrows(): print alert[u'sha1_hash'] 。它包含来自AV的恶意软件文件的SHA1哈希。

API_URL = service_url + alert[u'sha1_hash']
r = requests.post(API_URL, headers=HEADERS)
response = r.json()

现在我在循环中向服务发出API请求。

dict response

我想将alert[u'sha1_hash'] -> response[u'description']作为列添加到DataFrame对象中。然而,它也有100多个领域。有没有办法制作一个多维DataFrame,有一个像{{1}}这样的关系?所以我知道我正在查看每个警报的子表,其中包含我服务的信息?

我想避免搜索列。使用标签要容易得多。

0 个答案:

没有答案