When creating training data for RNN, the target label for a given input label is the input label itself but shifted by one position. Please refer to the diagram below.
enumerate() is a useful function to make an iterator when used with a
for loop. Here we explain different ways of using
enumerate() using a python list.
enumerate() acts as an iterator yielding a tuple
(index,element)when applied on a list.
Extend() when acting on a list