pandas corr get couple value

Solutions on MaxInterview for pandas corr get couple value by the best coders in the world

showing results for - "pandas corr get couple value"
Rhydian
10 Jan 2018
1# credit to the Stack Overflow user in the source link for this example
2
3import pandas as pd
4import numpy as np
5
6shape = (50, 4460)
7data = np.random.normal(size=shape)
8data[:, 1000] += data[:, 2000]
9
10df = pd.DataFrame(data)
11c = df.corr() # the correlation matrix
12s = c.unstack()
13so = s.sort_values(kind = "quicksort") # series containing all possible  couples