Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

find highest correlation pairs pandas

import pandas as pd
import numpy as np

shape = (50, 4460)

data = np.random.normal(size=shape)

data[:, 1000] += data[:, 2000]

df = pd.DataFrame(data)

c = df.corr().abs()

s = c.unstack()
so = s.sort_values(kind="quicksort")

print so[-4470:-4460]
Comment

PREVIOUS NEXT
Code Example
Python :: python array scalar multiplication 
Python :: Math Module tan() Function in python 
Python :: match statement 
Python :: check is string is nan python 
Python :: python datetime get weekday name 
Python :: file manage py line 17 from exc django 
Python :: create new column pandas lambda function assign apply 
Python :: pie plot in python 
Python :: print A to z vy using loop in python 
Python :: python next item in list 
Python :: how do you change a string to only uppercase in python 
Python :: delete element list python 
Python :: find sum numbers in a list in python 
Python :: oversampling using smote 
Python :: pandas get group 
Python :: php datatables serverside 
Python :: python sets 
Python :: How to send Email verification codes to user in Firebase using Python 
Python :: how to create an array in python 
Python :: flatten list python 
Python :: python openpyxl cell width 
Python :: adding text cv2 
Python :: python convert to hmac sha256 
Python :: ffill dataframe python 
Python :: load pt file 
Python :: next() python 
Python :: get dictionary values python 
Python :: merge all mp4 video files into one file python 
Python :: delete column in dataframe pandas 
Python :: python verify if string is a float 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =