相关疑难解决方法(0)

带有两个列表中的参数的函数

我有两个列表xscat和yscat.我希望列表理解能分别在xscat和yscat中选取x和y.结果列表应包含peaks([x[0], y[0]]), peaks([x[1], y[1]])

xscat=yscat=[-1, -1.5,5]
[peaks([x,y]) for x,y in xscat,yscat]
Run Code Online (Sandbox Code Playgroud)

你能找到任何使用理解的解决方案吗?或其他方式(地图)?

python dictionary list-comprehension

30
推荐指数
3
解决办法
2万
查看次数

标签 统计

dictionary ×1

list-comprehension ×1

python ×1