I have a list of items. I also have a dataframe. If the list has 3 items and the dataframe has 4 rows, I want to iterate and add each item and then copy the row and add the next item, etc. So the end result is a dataframe that went from 4 rows to 12 rows (4 rows times 3 items in a list). I tried converting df to list and then iterating via append and extend but it wasn't what I wanted, it just kept appending values to the list rather than copying a new list and only appending the current iterative value.
group start stop
0 abc 1/1/2016 8/1/2016
1 xyz 5/1/2016 12/1/2016
2 jkl 3/7/2017 1/31/2018
b = ['a','b','c','d']
The expected result is a dataframe like this:
group start stop new col
abc 1/1/2016 8/1/2016 a
abc 1/1/2016 8/1/2016 b
abc 1/1/2016 8/1/2016 c
abc 1/1/2016 8/1/2016 d
xyz 5/1/2016 12/1/2016 a
xyz 5/1/2016 12/1/2016 b
xyz 5/1/2016 12/1/2016 c
xyz 5/1/2016 12/1/2016 d
jkl 3/7/2017 1/31/2018 a
jkl 3/7/2017 1/31/2018 b
jkl 3/7/2017 1/31/2018 c
jkl 3/7/2017 1/31/2018 d