Categories
How to add an element to a numpy subarray?
There is an array data = . How do I add, say, 0 to the first subarray to get ?
Answer the question
In order to leave comments, you need to log in
A little fiddly, but it works.
import numpy as np array = np.array() to = len(a[0]) array = np.insert(array, to, 0, axis=1) print(array)
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question