Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 38 additions & 9 deletions build.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,51 @@
def get_categorical_variables(df):
return []
import numpy as np
import pandas as pd
from scipy.stats import norm
import seaborn as sns
import matplotlib.pyplot as plt

df = pd.read_csv('data/employee_retention_data.csv')

def get_numerical_variables(df):
return []
def get_categorical_variables(df):
categorical_data = list(df[['dept', 'join_date', 'quit_date']])
return categorical_data

def get_numerical_variables(df):
numeric = pd.DataFrame._get_numeric_data(df)
return list(numeric)

def get_numerical_variables_percentile(df):
pass
per = df.describe().T
return per


def get_categorical_variables_modes(df):
pass

return df[get_categorical_variables(df)].mode()

def get_missing_values_count(df):
pass
return pd.DataFrame(df.isnull().sum())


def plot_histogram_with_numerical_values(df):
pass

num_cols = get_numerical_variables(df)
plt.figure(figsize=(15,6))

plt.subplot(221)
plt.title(num_cols[0])
sns.distplot(df[num_cols[0]], color='Blue', fit=norm, kde=False)

plt.subplot(222)
plt.title(num_cols[1])
sns.distplot(df[num_cols[1]], color='Blue', fit=norm, kde=False)

plt.subplot(223)
plt.title(num_cols[2])
sns.distplot(df[num_cols[2]], color='Blue', fit=norm, kde=False)

plt.subplot(224)
plt.title(num_cols[3])
sns.distplot(df[num_cols[3]], color='Blue', fit=norm, kde=False)

plt.tight_layout()
plt.show()
Binary file added build.pyc
Binary file not shown.
Binary file added tests/__init__.pyc
Binary file not shown.
Binary file added tests/test_get_categorical_variables.pyc
Binary file not shown.