I have an array that looks like the one below (boston housing dataset)..
array = array([[ 6.32000000e-03, 1.80000000e+01, 2.31000000e+00, ...,
1.53000000e+01, 3.96900000e+02, 4.98000000e+00],
[ 2.73100000e-02, 0.00000000e+00, 7.07000000e+00, ...,
1.78000000e+01, 3.96900000e+02, 9.14000000e+00],
[ 2.72900000e-02, 0.00000000e+00, 7.07000000e+00, ...,
1.78000000e+01, 3.92830000e+02, 4.03000000e+00],
I can pick out a column like this:
column_zero = [:, np.newaxis][:, :, 5]
Which gives me something like
[[ 6.575]
[ 6.421]
[ 7.185]
[ 6.998]
[ 7.147]
[ 6.43 ]
...
Thats cool however what if I wanted to make a three dimensional array based on three columns such as 5, 2 and 0?
[[ 6.575, item_0_column_2, item_0_column_0]
[ 6.421, item_1_column_2, item_1_column_0]
[ 7.185, item_2_column_2, item_2_column_0]
[ 6.998, item_3_column_2, item_3_column_0]
[ 7.147, item_4_column_2, item_4_column_0]
[ 6.43 , item_5_column_2, item_5_column_0]
...
So basically to clarify, I want to construct an array of the columns 5, 2 and 0.