I can not reshape the array into 3-dimensional one. Here is the example dataset:
import pandas as pd
import numpy as np
df = {
"a": [0.06 , 0.07, 0.45, 0.98, 0.97 ],
"b": [12,45,65, 56, 34],
"c": [2,5,5, 5, 3],
"d": [23,55,25, 15, 34],
"e": [0.0005,0.55555,0.383825, 0.4747477415, 0.348344334],
"f": [0.0236 , 0.3407, 0.4545, 0.9658, 0.4597 ],
"g": [70 , 90, 123, 154, 99 ],
}
#load into df:
df = pd.DataFrame(df)
print(df)
df.shape
X = df[['a', 'b', 'c','d','e','f']].to_numpy()
y = df['g'].to_numpy()
X
This is what I found as a possible solution from one of the stackoverflow posts
# Reshaping the X data to be 3D
X = X.reshape(5, 7, -1)
But it did not work for me. I understand that matrix has its rules, however, is it possible to convert it into three dimensional array? Could you help me if you know? Thank you very much!
I want to get something like (5,7,3). The array that end with the 3.