我有两个列表xscat和yscat.我希望列表理解能分别在xscat和yscat中选取x和y.结果列表应包含peaks([x[0], y[0]]), peaks([x[1], y[1]])等
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]
你能找到任何使用理解的解决方案吗?或其他方式(地图)?
python dictionary list-comprehension
dictionary ×1
list-comprehension ×1
python ×1