我定义了以下函数:
def lattice_pipe(real_coords, guess_cmap):
guess_coords = laplacian_coords(guess_cmap)
return fitness(real_coords, kabsch(real_coords,guess_coords))
我这样称呼它:
^{pr2}$但我得到了以下错误:
fit = list(map(functools.partial(lattice_pipe, real_coords = coords_real, guess_cmap = cmap_guess), population))
TypeError: lattice_pipe() got multiple values for argument 'real_coords'
我不明白为什么我会得到这个,因为我想我只给出了它需要的两个参数,一个是真坐标,另一个是猜想。。。在
谢谢你的帮助!在
如果要从
population
获取guess_cmap
,请不要在functools.partial()
调用中绑定它。使用列表理解从每个元素中提取它。在相关问题 更多 >
编程相关推荐