如果某个特定的列值没有出现在先前定义的字典中,我会尝试从数据帧中删除行
dff= dff[dff['network'] in net_dic]
“network”的每个值都是一个字符串。net_dic看起来像这样:
{ 'abc' : 1
'def' : 2
.
.
.}
It错误:
TypeError: 'Series' objects are mutable, thus they cannot be hashed
发布于 2019-03-15 08:00:33
啊,这行得通:
dff= dff[dff['network'].isin(net_dic.keys())]
https://stackoverflow.com/questions/55173686
复制相似问题