When the ddof parameter is equal to the table length (after preprocessing the axis), we essentially divide by zero when we compute the standard deviation. In pure q, this results in infinite values (0W), but in pandas, this operation results in nan values, so I kept this later case on my implementation to match pandas' imlementation.
Also, pandas' implementation includes an extra parameter, skipna. However, since it's ignored on mean and median, it has been ignored here as well
An implementation of the
std
function: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.std.htmlWhen the
ddof
parameter is equal to the table length (after preprocessing theaxis
), we essentially divide by zero when we compute the standard deviation. In pure q, this results in infinite values (0W), but in pandas, this operation results innan
values, so I kept this later case on my implementation to match pandas' imlementation.Also, pandas' implementation includes an extra parameter,
skipna
. However, since it's ignored onmean
andmedian
, it has been ignored here as well