# NA-ignoring aggregations

**URL:** <https://discourse.julialang.org/t/na-ignoring-aggregations/19120>\
**Category:** General Usage\
**Created:** [December 30, 2018, 4:22pm UTC](https://discourse.julialang.org/t/na-ignoring-aggregations/19120 "2018-12-30T16:22:52Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [December 30, 2018, 6:22pm UTC](https://discourse.julialang.org/t/na-ignoring-aggregations/19120/8 "2018-12-30T18:22:02Z")

</div>

> You can always convert from one type to the other, in case of `NaN` you can use, e.g., `replace!(x -> isnan(x) ? missing : x, arr)` .

This requires making another copy of data, and makes some kinds of interoperability (when the memory layout is important) impossible inplace.

> I guess the way to achieve it is `mapslices(x -> mean(skipmissing(x)), arr, dims=1)`.

Yes, I know about that, but it’s much slower - see an [older post of mine](https://discourse.julialang.org/t/general-reduction-performance/15675).

> the [DataFrames](https://github.com/JuliaData/DataFrames.jl/) library has many of such use cases nicely covered

I though that dataframes are basically collections of 1D arrays, so don’t see how it can help with n-dimensional reductions.

---

_[View the full topic](https://discourse.julialang.org/t/na-ignoring-aggregations/19120)._
