I want to be able to concat dataframe results to memory as they go through a function and end up with a whole new dataframe with just the results. How do I do this without having a dataframe all ready created before the function? For example:
import pandas as pd
import numpy as np
rand_df = pd.DataFrame({'A': [ 'x','x','y','y','z','z','z'],'B': np.random.randn(7)})
def myFuncOnDF(df, row):
df = df.groupby(['A']).get_group(row).describe()
myFuncOnDF(rand_df, 'x')
myFuncOnDF(rand_df, 'y')
myFuncOnDF(rand_df, 'z')
How would I concat the results of myFuncOnDF() to a new dataframe that doesn't exist yet?