Three unit tests:
1) Test if a data frame
2) Test the shape
3) Test docstring
In [ ]:
def test_attrition_data():
att_test = load_data()
assert isinstance(att_test, pd.DataFrame)
assert left.shape == stayed.shape
test_attrition_data()
# Test docstring
def _test()
import doctest
doctest.testmod()
if __name__ == "__main__":
_test()
Caveats and mathematical notes:
Right hand skewed distribution (i.e. asymmetrical distribution) changes statistics. In future consider using median versus mean to accurately calculate statistical comparisons.
Equation for non-parametric skew:
In [ ]: