Homework #3 from SEDS
note This assignment is also about process, not just the end product. Keep your notebook clean, but be clear to show your development process, i.e. how you got from your design, to some test lines of code, to the final function. Use Markdown to document your process.
- Create a new Jupyter notebook called 'SEDS-HW3.ipynb' and finish the in class excersize of creating a functionalized block of code to compute the pairwise correlation between rows in a pandas data frame. Use Markdown between cells to document your work. Be sure to use docstrings for all of your functions. Hint / requirement You should have three functions. One for the whole entity
pairwise_correlation
, one for comparing two rowscorr_rowi_rowj
, and one for comparing one row to all the other rowscorr_rowi_vs_all
. - Move your functions to
df_utils.py
and import that file and the functions into the notebook. - For each function, create cell with assert statements that tests various aspects of your function, including handling oddball inputs, expected outputs (size, shape and values). Try to have at least three tests per function.
- Convert the cells to unit test functions and save them to
test_df_utils.py
. Hint Don't forget to name the functions with thetest_
prefix! - Run the unit tests with
nosetests
at the command line and paste the output into this README.md below.
Ran 3 tests in 0.685s
OK