I have two pandas dataframes that have the same column names and the data relates to different product types in each dataframe. For example, both look like this but are unequal in lengths.
df1
Name ScoreX ScoreY ScoreZ
Type1 0.6 0.2 0.7
Type2 0.6 0.5 0.6
Type3 0.7 0.2 0.3
Type4 1.0 0.2 0.3
df2
Name ScoreX ScoreY ScoreZ
TypeA 0.5 0.1 0.9
TypeB 0.3 0.5 0.6
TypeC 0.7 0.8 0.2
TypeD 1.0 0.2 0.3
I am trying to create new hybrid values of each type which combines each product in df1 with df2 and the score values are the means on both product's individual scores. Looking for a way to iterate both frames so the first row of df1 is combined with each row in df2 then this process is repeated for each row again in df1. So the output would look like this in a new df:
Name MeanScoreX MeanScoreY MeanScoreZ
Type1_TypeA 0.55 0.15 0.8
Type1_TypeB 0.45 0.35 0.65
.......
Type2_TypeA 0.55 0.3 0.75
Type2_TypeB 0.45 0.5 0.6