Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

corr pandas

import seaborn as sns
#load the dataset
df = sns.load_dataset('iris')
#calculate correlation
corr_matrix = df.corr('pearson') #kind of correlation->  ‘pearson’, ‘kendall’, ‘spearman’
#plot correlation
corr_matrix.style.background_gradient(cmap='coolwarm')
# 'RdBu_r', 'BrBG_r', & PuOr_r are other good diverging colormaps
Comment

PREVIOUS NEXT
Code Example
Python :: python datetime module 
Python :: hello world in python 
Python :: python loop list from last to first 
Python :: api testing with python 
Python :: pandas change dtype to timestamp 
Python :: intersection between two arrays using numpy 
Python :: where is tensorflow slim 
Python :: how to find the datatype of a dataframe in python 
Python :: python check if number is in range 
Python :: print map object python 
Python :: seaborn countplot 
Python :: python depth first search 
Python :: python how to change back to the later directory 
Python :: python zeros to nan 
Python :: pyautogui press 
Python :: access sqlite db python 
Python :: jupyter markdown new line 
Python :: pandas write to excel 
Python :: Create list with numbers between 2 values by 
Python :: how to make django model field case insensitive 
Python :: rotate image in pygame 
Python :: pandas delete column by name 
Python :: python regex tester 
Python :: how to make a separate list of values from dictionaries in python 
Python :: replace string if it contains a substring pandas 
Python :: copy string python 
Python :: django create new project 
Python :: python get last element of list 
Python :: drop column from dataframe 
Python :: how to clear ipython console 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =