Skip to content

Commit 744123f

Browse files
committed
Added cor_map docstring
1 parent 46430f7 commit 744123f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

eda_utils_py/eda_utils_py.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
def cor_map(dataframe, num_col):
3+
"""
4+
A function to implement a correlation heatmap including coefficients based on given numeric columns of a data frame.
5+
6+
Args:
7+
dataframe (pandas.DataFrame): The data frame to be used for EDA.
8+
num_col (list): A list of string of column names with numeric data from the data frame.
9+
10+
Returns:
11+
(altair): A correlation heatmap plot with correlation coefficient labels based on the numeric columns specified by user.
12+
13+
Examples:
14+
import pandas as pd
15+
from eda_utils_py import cor_map
16+
17+
data = pd.DataFrame({
18+
'SepalLengthCm':[5.1, 4.9, 4.7],
19+
'SepalWidthCm':[1.4, 1.4, 1.3],
20+
'PetalWidthCm:[0.2, 0.2, 0.2],
21+
'Species':['Iris-setosa','Iris-virginica']
22+
})
23+
24+
numerical_columns = ['SepalLengthCm','SepalWidthCm','PetalWidthCm']
25+
26+
cor_map(data, numerical_columns)
27+
28+
"""

0 commit comments

Comments
 (0)