xxxxxxxxxx
#source: https://www.kite.com/python/answers/how-to-convert-a-2d-numpy-array-to-a-1d-array-in-python
array_1d = array_2d. flatten() flatten `array_2d`
print(array_1d)
xxxxxxxxxx
float weightList[6]={2.50,4.60,2.27,5.67,11.34,8.11};
float amountList[6]={0.01,0.05,0.10,0.25,0.5,1};
xxxxxxxxxx
x = x.reshape(-1, 1)
# remember to check shape of your variable using x.shape, if it shows
# (y, n) then it is already 2D, if it shows (y,) instead, it is 1D.