Given an n-dimensional numpy array. Now an axis and corresponding index is given. All elements in that particular axis-index should be replaced by given value. Example of an three-dimensional array:
>>a = np.ones((2,2,2))
array([[[ 1., 1.],
[ 1., 1.]],
[[ 1., 1.],
[ 1., 1.]]])
Given axis=1, index=0. All elements in this axis-index needs to be zero.
>>a
array([[[ 0., 0.],
[ 1., 1.]],
[[ 0., 0.],
[ 1., 1.]]])