In R, when adding new data of unequal length to a data frame, the values repeat to fill the data frame:
df <- data.frame(first=c(1,2,3,4,5,6)) df$second &
The cycle method from itertools is good for repeating a common pattern.
from itertools import cycle seq = cycle([1, 2, 3]) df['Seq'] = [next(seq) for count in range(df.shape[0])]