map_thread 函数
对多个列表中对应的元素应用一个函数。
怎么写
map_thread(f, lists)
- f
- 要应用的函数。接受一个函数。
- lists
- 由等长列表构成的列表。接受一个列表。
示例
map_thread(plus, [[1, 2], [3, 4]])在求解器中,
在求解器中打开map_thread(plus, [[1, 2], [3, 4]])的结果是[4, 6]。
对多个列表中对应的元素应用一个函数。
map_thread(plus, [[1, 2], [3, 4]])在求解器中,map_thread(plus, [[1, 2], [3, 4]]) 的结果是 [4, 6]。