# Is there a dropna() for DataFrame?

**URL:** <https://discourse.julialang.org/t/is-there-a-dropna-for-dataframe/1777>\
**Category:** Statistics\
**Tags:** question\
**Created:** [January 30, 2017, 3:17am UTC](https://discourse.julialang.org/t/is-there-a-dropna-for-dataframe/1777 "2017-01-30T03:17:05Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [March 22, 2017, 9:13am UTC](https://discourse.julialang.org/t/is-there-a-dropna-for-dataframe/1777/22 "2017-03-22T09:13:05Z")

</div>

Right, I’ll file issues to begin with 🙂  
Here is one on DataTables including a modification of @mwsohn code [https://github.com/JuliaData/DataTables.jl/issues/38](https://github.com/JuliaData/DataTables.jl/issues/38)  
I just realized that `lm` already deals with NAs so maybe there is no reason to open a further issue there.

---

<div class="post-metadata">

**Author:** ![mwsohn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mwsohn/32/2696_2.png) [@mwsohn](https://discourse.julialang.org/u/mwsohn)\
**Post date:** [March 22, 2017, 1:49pm UTC](https://discourse.julialang.org/t/is-there-a-dropna-for-dataframe/1777/23 "2017-03-22T13:49:46Z")

</div>

Actually, what I think is more useful is a dropna which returns a data frame, not a boolean array like completecases, after dropping rows with NAs or NULLs on some columns. My two cents.

---

<div class="post-metadata">

**Author:** ![nalimilan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nalimilan/32/147_2.png) [@nalimilan](https://discourse.julialang.org/u/nalimilan)\
**Post date:** [March 22, 2017, 2:02pm UTC](https://discourse.julialang.org/t/is-there-a-dropna-for-dataframe/1777/24 "2017-03-22T14:02:53Z")

</div>

That’s actually what `dropnull` does in DataTables now:  
[https://github.com/JuliaData/DataTables.jl/pull/6](https://github.com/JuliaData/DataTables.jl/pull/6)

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [March 22, 2017, 2:11pm UTC](https://discourse.julialang.org/t/is-there-a-dropna-for-dataframe/1777/25 "2017-03-22T14:11:47Z")

</div>

For the col-specific case, and possibly every case for consistency, I think it should return a `view`.

[Previous page](https://discourse.julialang.org/t/is-there-a-dropna-for-dataframe/1777.md?page=1)
