Renamed function (it doesn't add percentiles; the output data frame has a different shape to the input data frame)
Renamed parameters
Simplified generation of quantiles
Avoided calling rename (and remembering a default series name) by passing a series to .quantile
Updated function and parameter names in the test (but not the behaviour of the test)
There are more changes here in fewer commits than previously, however the document/test/refactor loop is the same.
I'm not sure whether you use a REPL (Read Evaluate Print Loop), or open a shell like ipython to execute code. If you do, then you can use a pytest fixture like this:
from tests import test_notebooks_utilities
measure_table = test_notebooks_utilities.measure_table.__wrapped__()
You can then use this to test compute_deciles like this:
from notebooks import utilities
utilities.compute_deciles(measure_table, "date", "value")
The final commit is the most important. Changes:
.quantile
There are more changes here in fewer commits than previously, however the document/test/refactor loop is the same.
I'm not sure whether you use a REPL (Read Evaluate Print Loop), or open a shell like
ipython
to execute code. If you do, then you can use a pytest fixture like this:You can then use this to test
compute_deciles
like this: