Skip to content Skip to sidebar Skip to footer

Is There Some Numpy.map?

I may be missing something obvious here, but I am missing a function numpy.map. What that would be is the same as Python's map function, but collect the output in a numpy array. Fo

Solution 1:

If I got you right you need column_stack that would work like this:

import numpy as np

a = np.array([[1, 2], [3, 4], [5, 6]])

a = np.column_stack((range(3), a))

a
[[0 1 2]
 [1 3 4]
 [2 5 6]]

Post a Comment for "Is There Some Numpy.map?"