我编写了以下代码。 我已经写了double for循环,有没有办法用Python改进此代码? 如果您有好的方法或语法,请告诉我。
for i, (product, new_category) in enumerate(zip(interpark.products_name, interpark.new_category)):
for j, (word, standard) in enumerate(zip(filterword.word, filterword.category)):
if word in product:
interpark.new_category[i] = standard
print('product:' + product + '\t' + 'new category:' + interpark.new_category[i])