在python中搜索tsv文件的单个列中的字符串

时间:2017-11-16 15:57:11

标签: pandas

我有一个如下列表。

visibility: hidden

我还有一个带列标题的tsv文件 - > mylist=['code1', 'code5', 'code11'] idquantity_details

ingredients

现在,我想仅在id quantity_details ingredients code1 tim tam 5, sugar 500g recipe of code 1 here. code2 milk 2L, sugar 250g eggs 5 recipe of code 2 here. 中搜索tsv文件的mylist列中的代码,并将相应的idquantity_details值作为单个值返回串。即ingredients的字符串应为= code1<corresponding quantity_details value>

预期产出:

<corresponding ingredients value>

我们可以在python中使用pandas吗?

0 个答案:

没有答案