0

What is the function to be used in numpy to obtain the following result?

import numpy as np
store = np.array([0,0,1,2])
cost = np.array([1,11,12,13])

O/P

[[0,1],[0,11],[1,12],[2,13]]
Alex
  • 947
  • 6
  • 16

2 Answers2

0

np.column_stack((store,cost))

will give the output as expected

0

The function pack does this behaviour:

pack = zip(store, cost)

With this function you will get:

[(0, 1), (0, 11), (1, 12), (2, 13)]
delolath78
  • 55
  • 9