You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The summarize() function is hard-wired to use the MEAN as the central summary measure of the model results it is "summarising". 'mean' is also used as the name of the column giving the central summary measure; and only_mean is the kwarg used to get only the central summary measure.
... but sometimes we want the MEDIAN!
Simplest option would be to leave this function alone, and create a new one called summarize_with_median() that does similarly but uses median (for the stat, the name of the column and the kwarg). (Or, accomplish the same external behaviour through refactoring.) Or could create a kwarg stat: Literal["mean", "median"] that defaults to mean; and when median gives the title column of median, and we refactor the kwarg to be only_central instead of only_mean. (We could avoid wide-spread refactoring by also accepting an argument for only_mean, under certain circumstances.)
The text was updated successfully, but these errors were encountered:
The summarize() function is hard-wired to use the MEAN as the central summary measure of the model results it is "summarising". 'mean' is also used as the name of the column giving the central summary measure; and
only_mean
is the kwarg used to get only the central summary measure.... but sometimes we want the MEDIAN!
Simplest option would be to leave this function alone, and create a new one called
summarize_with_median()
that does similarly but uses median (for the stat, the name of the column and the kwarg). (Or, accomplish the same external behaviour through refactoring.) Or could create a kwargstat: Literal["mean", "median"]
that defaults to mean; and when median gives the title column ofmedian
, and we refactor the kwarg to beonly_central
instead ofonly_mean
. (We could avoid wide-spread refactoring by also accepting an argument foronly_mean
, under certain circumstances.)The text was updated successfully, but these errors were encountered: