【发布时间】:2018-03-24 15:28:54
【问题描述】:
我正在尝试搜索row,其中包含列表中的字符串。
df:
Column1 Out1
0 ['x', 'y'] (0, 2)
1 ['a', 'b'] (3, 0)
etc.
按照this 回答中的建议,我已尝试以下方法在list 下的list 中搜索包含'a' 的行 回答:
print df['Column1'].isin(['a'])
期待这样的结果:
1 ['a', 'b'] (3, 0)
但是,我似乎收到以下错误:
TypeError: unhashable type: 'list'
【问题讨论】:
标签: python regex python-2.7 pandas