Mapping element-wise a NumPy array into an array of more dimensions
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I want map a numpy.array from NxM to NxMx3, where a vector of three elements is a function of the original entry: lambda x : [ f1 ( x ), f2 ( x ), f3 ( x )] However, things like numpy.vectorize do not allow to change dimensions. Sure, I can create an array of zeros and make a loop ( and it is what I am doing by now ), but it does not sound neither Pythonic nor efficient (as every looping in Python). Is there a better way to perform an elementwise operation on numpy.array, producing a vector for each entry? 回答1: Now that I see your