My issue is this. I have an array like this :
test = array([[1],[2],[10] .... [-5]])
I want to be able to just convert this to an array that looks like this
test = [1,2,10,..., -5]
The test is a numpy array.
My issue is this. I have an array like this :
test = array([[1],[2],[10] .... [-5]])
I want to be able to just convert this to an array that looks like this
test = [1,2,10,..., -5]
The test is a numpy array.
You can use reshape() to change the array into 1D array as:
import numpy as np
test = np.array([[1],[2],[10],[-5]])
test=test.reshape((test.shape[0],)) # test.shape[0] gives the first dimension (the number of rows)
# reshape changes test array to one dimensional array with shape (test.shape[0],)
print(test)