我有:
adj response
"beautiful" ["beautiful", "beautiful2", "beautifu3"]
"good1" ["beautiful1", "beautiful2", "beautifu3"]
"hideous" ["hideous23r", "hideous", "hidoeous"]
我想要一个额外的列,其中包含前一列中项目的第一个索引:
adj response index
"beautiful" ["beautiful", "beautiful2", "beautifu3"] 0
"not there" ["beautiful1", "beautiful2", "beautifu3"] None
"hideous" ["hideous23r", "hideous", "hidoeous"] 1
让我们试着打开列表
尝试:
输出:
一种非常天真的方法:
(假设“response”中的列表对应一个字符串) 这是最糟糕的方式,我认为比Nk03解决方案慢
相关问题 更多 >
编程相关推荐