# Save DataFrame containing arrays

**URL:** <https://discourse.julialang.org/t/save-dataframe-containing-arrays/10927>\
**Category:** Data\
**Created:** [May 16, 2018, 12:25pm UTC](https://discourse.julialang.org/t/save-dataframe-containing-arrays/10927 "2018-05-16T12:25:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![LaurentPlagne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laurentplagne/32/10103_2.png) [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Post date:** [May 16, 2018, 12:25pm UTC](https://discourse.julialang.org/t/save-dataframe-containing-arrays/10927/1 "2018-05-16T12:25:04Z")

</div>

I want to manipulate performance experiments data, store/load these data from a file.

I try to use DataFrames.jl which looks OK. When I want to store my data in a csv file, it fails if my data contains arrays of floats.

What format should I use for this purpose ?

```julia
using DataFrames
using CSV

mm=DataFrame(action = ["toto","tutu"], gflops = [1.2,5.6])
CSV.write("./mm1.csv",mm) #OK

measurements=DataFrame(action = ["toto","tutu"], gflops = [[1.2,3.4,5.6],[5.6,6.7,7.8]])
CSV.write("./mm.csv",measurements)#KO

```

Laurent

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [May 16, 2018, 12:34pm UTC](https://discourse.julialang.org/t/save-dataframe-containing-arrays/10927/2 "2018-05-16T12:34:50Z")

</div>

JLD.jl, JLD2.jl or [https://github.com/MikeInnes/BSON.jl](https://github.com/MikeInnes/BSON.jl) can store (almost) arbitrary Julia objects.

---

<div class="post-metadata">

**Author:** ![LaurentPlagne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laurentplagne/32/10103_2.png) [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Post date:** [May 16, 2018, 12:41pm UTC](https://discourse.julialang.org/t/save-dataframe-containing-arrays/10927/3 "2018-05-16T12:41:56Z")

</div>

Thanks !  
I have an additional question. I wanted to store the file on a git server, I thought that textual format could be efficiently handled by git (storing only diffs). I guess that this basic approach will not work with JDL or BSON…  
What should I do ?

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [May 16, 2018, 12:47pm UTC](https://discourse.julialang.org/t/save-dataframe-containing-arrays/10927/4 "2018-05-16T12:47:56Z")

</div>

git is not really made to store data, even in text format. But it’s probably ok as long as your data is small (irrespective of wether text or binary). If your data really only changes a little and it is essential that git takes advantage of storing diffs, then you could consider other text based formats such as JSON, YAML or XML, for which there are probably packages around.

---

<div class="post-metadata">

**Author:** ![LaurentPlagne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laurentplagne/32/10103_2.png) [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Post date:** [May 16, 2018, 12:52pm UTC](https://discourse.julialang.org/t/save-dataframe-containing-arrays/10927/5 "2018-05-16T12:52:51Z")

</div>

Thank you very much !
