October 2018
Intermediate to advanced
252 pages
6h 49m
English
Let's look at how to pad with a non-default value (1.0, in this case):
padded_value = pad_sequences(sequences, value=1.0)print(padded_value)
The following is the output of the preceding code snippet. Notice that all the arrays have been made of length 4 with 1 as the padding value:
[[1 2 3 4] [1 5 6 7] [1 1 1 5]]
Read now
Unlock full access