'How to loop each row separately?
My desired output would be:
[[7,8,9,10,11,12], [7,8,9,10,11,12],[7,8,9,10,11,12], [9,10,11,12], [11,12]... etc
Any Idea on how to do so? Sorry for the confusion, I am new to python.
Solution 1:[1]
list(map(lambda x : list(range(x[0], x[1]+1)), df[['StartMonth','EndMonth']].values))
df is the Pandas DataFrame of your table.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | SM1312 |
