Alexander Plavin

Results 348 comments of Alexander Plavin

Maybe, `median`/`quantile` can simply return `nothing` instead of throwing? Seems nonbreaking, and allows for easy default selection through `something(...)`.

Another idea is a general wrapper function so that the interface looks like `onempty(median, xs, default=0.0)`.

> The point is that isempty(skipmissing(x)) is O(n) operation in general Good point! I mostly considered applying functions to an actual materialized array, not to `skipmissing`. An advantage of `onempty`...

Some Julia functions throw an exception when no result is available (eg `first`), some do return `nothing` (eg `findfirst`). Btw, `first`-or-default and `only`-or-default functions would also useful to have...

It's unfortunate, but is a fact, that functions in Julia tend not to really consider that `nothing` can be contained within a collection. For example, `findfirst` returns `nothing` when it...

I also like this solution, but wonder if it's possible to generalize in the following sense, while keeping simple and intuitive. Often, one wants to compute `mean`/`median`/`std`/whatever only when at...

The "median, but necessarily from the original dataset" is also called [medoid](https://en.wikipedia.org/wiki/Medoid). So this could be the name of a new function. Compared to `median_low` and `_high`, `medoid` directly generalizes...

Another idea for a general and convenient interface, that encompasses both isempty and length checks: ```julia iflength(median, 0 => NaN)(x) # NaN if x is empty iflength(median, 0:3 => NaN)(x)...