I have a DataFrame object stocks filled with stock returns. I have another DataFrame object industries filled with industry returns. I want to find
stocks
industries
And here's a one-liner that uses apply on the columns and avoids the nested for loops. The main benefit is that apply builds the result in a DataFrame.
apply
df1.apply(lambda s: df2.corrwith(s))