I'm trying to import the below data (excel file) into a 2D numpy array
x1 | x2
12 | 56
34 | 89
43 | 10
34 | 11
My Python code:
spreadsheet = 'zone.xlsx'
data = pd.read_excel(spreadsheet)
x = data['x1'].values
y = data['x2'].values
x_train = np.concatenate((x,y))
The problem is that the output for x_train is [12, 34, 43, 34, 56, 89, 10, 11] and I would like to get the following output:
[[12, 56], [34, 56], [43,10], [34,11]]
.values.shape, the result is(8,). I want to get(4, 2,2)as.shapedata.valuesordata.to_numpy()?