May-26-2020, 05:06 AM
Comprehensions can be unwound. Start at the end and work your way back to the assignment. Use the same process, but in reverse, to convert for loops to a comprehension.
for child in children: for month in months: dataset1.append( (month, np.dot(month, 24.7)+np.random.normal(loc=0, scale=20)) )