Reputation: 73
All help is much much appreciated! Thanks
I need correlation along the rows I know how to get corr between two columns, see below.
How I get the corr along the rows in a new column? corr (11 with 84 2 with 81) etc
df['Bananas'].corr(df['Weight'])
df = pd.DataFrame({'Bananas': [11, 2, 0.5], 'Weight': [84, 81, 78]})
Upvotes: 0
Views: 153
Reputation: 348
What you're looking for is df.corrwith(). This finds correlation row-wise.
Upvotes: 1