# Write CSV with nulls from dataframe

**URL:** <https://discourse.julialang.org/t/write-csv-with-nulls-from-dataframe/8167>\
**Category:** Data\
**Tags:** question\
**Created:** [January 4, 2018, 11:39pm UTC](https://discourse.julialang.org/t/write-csv-with-nulls-from-dataframe/8167 "2018-01-04T23:39:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonjilla](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@jonjilla](https://discourse.julialang.org/u/jonjilla)\
**Post date:** [January 4, 2018, 11:39pm UTC](https://discourse.julialang.org/t/write-csv-with-nulls-from-dataframe/8167/1 "2018-01-04T23:39:11Z")

</div>

I’m trying to write a CSV file using the CSV.jl package but am getting this error

julia\> CSV.write(“/tmp/out.csv”,testmap)  
ERROR: TypeError: streamto!: in typeassert, expected String, got DataArrays.NAtype

I thought the new DataFrames and CSV package would resolve this type of issue. How do I get around this?

CSV version 0.1.5  
DataFrame version 0.11  
Julia version is 0.6.2

---

<div class="post-metadata">

**Author:** ![bicycle1885](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bicycle1885/32/107_2.png) [@bicycle1885](https://discourse.julialang.org/u/bicycle1885)\
**Post date:** [January 5, 2018, 5:12am UTC](https://discourse.julialang.org/t/write-csv-with-nulls-from-dataframe/8167/2 "2018-01-05T05:12:39Z")

</div>

I think providing `testmap` here would be good to help you, or we cannot reproduce the problem.

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [January 5, 2018, 5:48am UTC](https://discourse.julialang.org/t/write-csv-with-nulls-from-dataframe/8167/3 "2018-01-05T05:48:54Z")

</div>

This might be a package version mismatch. I think DataFrames v0.11 needs DataArrays v0.7, and that I believe doesn’t have the `NAtype` anymore, so you probably are stuck on an old DataArrays version. I also think that CSV.jl v0.2.0 is the version that works with DataFrames v0.11.

I thought there were enough bounds in place in METADATA to make sure you only get things that match, but maybe not?

---

<div class="post-metadata">

**Author:** ![jonjilla](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@jonjilla](https://discourse.julialang.org/u/jonjilla)\
**Post date:** [January 5, 2018, 7:49am UTC](https://discourse.julialang.org/t/write-csv-with-nulls-from-dataframe/8167/4 "2018-01-05T07:49:43Z")

</div>

I think I see the issue. I have a julia package OdsIO installed. It forced a downgrade of the CSV and DataArrays package.
