Iteration over two grouped data frames

Hi there,

I am new to Julia using it for my data analysis. I am currently iterating over a grouped data frame with
for (i, gdf) in enumerate(groupby(df, :var, sort = true))
for visualtization purposes (one plot for each group). Yet I have a second dataframe for a second group of people with the same groups, which I want to plot in the same plot.
Is there some function like zip(a,b) which workes for grouped dataframes?
I’ve tried
for (i, (gdf, gdf_c)) in enumerate(zip(groupby(df, :var, sort = true)), groupby(df2, :var, sort = true))
but it doesn’t work.
Any help on how to solve this elegantly is appreciated.

Thanks in advance!

Use

for (i, (gdf, gdf_c)) in enumerate(zip(groupby(df, :var, sort = true), groupby(df2, :var, sort = true)))
1 Like