There is a numpy array
like following numpy array. I want to generate a random integer
number for specific string
of the numpy array.. How can I do this task?
# input
X = np.array([['a', 'p', 'b'],
['a', 'p', 'd'],
['c', 'p', 'd'],
['c', 'p', 'e'],
['c', 'p', 'f']])
# output
X = np.array([[100, 5, 101],
[100, 5, 103],
[102, 5, 103],
[102, 5, 104],
[102, 5, 105]])