I have a for loop that iterates over a dataframe and calculates two pieces of information:
for id in members['id']
x = random_number_function()
y = random_number_function()
I'd like to store id, x and y in a dataframe that is built one row at a time, for each pass through the for loop.
members['x'] = calculate_x(members['id'])and again for the 'y' column?calculate_code to accept a Series so it's vectorisednp.random.randintor whatever functions, it's really unnecessary generally to ever loop row-wise