If I have pandas dataframe includes 3 columns Col1
& Col2
& Col3
and I need to get max Pearson's correlation coefficient between Col2
and Col3
By considering the values in Col1
where the modified values For Col2
obtained by the next formula:
df['Col1']=np.power((df['Col1']),B)
df['Col2']=df['Col2']*df['Col1']
where B is the changing variable to get max Pearson's correlation coefficient between Col3
and the new values of Col2
So is there a Python method that can do that and return B.Is there a way to do this operation using Python and return B value, where I want to repeat this process to other columns.