As I create new data frames for each customer I'd like to also create one giant data frame of all of them appended together.
I've created a function to group user data how I need it. Now I want to iterate over another data frame containing unique user keys and use those user keys to create data frames for each user. I'd then like to aggregate all those data frames into one giant data frame.
for index, row in unique_users.iterrows():
customer = user_df(int(index))
print(customer)
This function works as intended and prints a df for each customer
for index, row in unique_users.iterrows():
top_users = pd.DataFrame()
customer = user_df(int(index))
top_users = top_users.append(customer)
print(top_users)
This only prints out the last customer's df
I expect that as it iterates and creates a new customer df it will append that to the top_user df so at the end I have one giant top_user df. But instead it only contains that last customer's df.