You created your scaled_inputs_all
DataFrame using loc
function, so it most likely contains no consecutive indices.
On the other hand, you created shuffled_indices
as a shuffle
from just a range of consecutive numbers.
Remember that scaled_inputs_all[shuffled_indices]
gets rows
of scaled_inputs_all
which have index values equal to
elements of shuffled_indices
.
Maybe you should write:
scaled_inputs_all.iloc[shuffled_indices]
Note that iloc
provides integer-location based indexing, regardless of
index values, i.e. just what you need.