I have some features
that look like this
[array([-725.91003 , 51.094467 , 14.295977 , ..., -1.7903049,
-1.7903049, -1.7903049], dtype=float32),
array([-7.5625812e+02, 7.8090454e+01, -2.7161818e+00, ...,
-4.3733236e-01, -4.3733236e-01, -4.3733236e-01], dtype=float32),
array([-748.3388 , 73.042336 , 3.2872062, ..., 0.7631229,
0.7631229, 0.7631229], dtype=float32),
array([-727.7924 , 104.6542 , 5.8776445, ..., -1.7250983,
-1.7250983, -1.7250983], dtype=float32),
array([-626.4832 , 49.174232 , -17.049093 , ..., -1.8033456,
-1.8033456, -1.8033456], dtype=float32),
array([-7.2422760e+02, 1.0093343e+02, 1.8611973e+01, ...,
5.7193387e-01, 5.7193387e-01, 5.7193387e-01], dtype=float32),
array([-7.6023083e+02, 7.8462936e+01, -7.6474414e+00, ...,
2.0393424e-01, 2.0393424e-01, 2.0393424e-01], dtype=float32),
array([-732.217 , 111.95129 , 7.088293 , ..., -0.8722699,
-0.8722699, -0.8722699], dtype=float32),
array([-7.2999091e+02, 5.5315689e+01, 6.6589708e+00, ...,
-5.7534605e-01, -5.7534605e-01, -5.7534605e-01], dtype=float32),
array([-7.5546600e+02, 7.5549866e+01, -1.7497752e+00, ...,
1.6348878e-01, 1.6348878e-01, 1.6348878e-01], dtype=float32),
array([-735.93207 , 67.90759 , 5.9061728, ..., -0.7860311,
-0.7860311, -0.7860311], dtype=float32),
array([-7.5995685e+02, 6.4485733e+01, 5.4719698e-01, ...,
-4.0942365e-01, -4.0942365e-01, -4.0942365e-01], dtype=float32),
array([-7.2625726e+02, 7.6061371e+01, 2.1122944e+01, ...,
6.2402117e-01, 6.2402117e-01, 6.2402117e-01], dtype=float32)]
How can I put them in a correct sequence. I want to have one outer np.array
, and all the arrays that are inside must become lists. I want to put this np.array
to a PCA. Generally speaking I want them in np.array
format, but with the correct way.
Then I want to do something like that
pca = PCA(n_components=2)
f2d= pca.fit_transform(features)
If I do that with my initial format I take an error message
ValueError: setting an array element with a sequence.