'Question - What is the pearson correlation between average dew point and average temperature? my code:

This is my Code *

corr_matrix = np.corrcoef(data['Average dewpoint (°F)']data['Average temperature(°F)'])

corr = "corr = " + str(round(corr_matrix[1][0], 2))

corr

Error:----

File "<ipython-input-9-2d98b56652c2>", line 1 corr_matrix = np.corrcoef(data['Average dewpoint (°F)'], data['Average temperature ^ SyntaxError: EOL while scanning string literal

I have try several methods , But didnt find this !



Solution 1:[1]

corr_matrix = np.corrcoef(data['Average dewpoint (°F)'],data['Average temperature (°F)'])

corr = "corr = " + str(round(corr_matrix[1][0], 2))

corr

The above worked for me.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Shraoshree Ghosh