# Very strange, can not create a data frame with the following simple example

**URL:** <https://discourse.julialang.org/t/very-strange-can-not-create-a-data-frame-with-the-following-simple-example/28147>\
**Category:** General Usage\
**Created:** [August 29, 2019, 1:16am UTC](https://discourse.julialang.org/t/very-strange-can-not-create-a-data-frame-with-the-following-simple-example/28147 "2019-08-29T01:16:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Post date:** [August 29, 2019, 1:16am UTC](https://discourse.julialang.org/t/very-strange-can-not-create-a-data-frame-with-the-following-simple-example/28147/1 "2019-08-29T01:16:52Z")

</div>

I have the following simple code to create a data frame.

```julia
function writeAmbsFile(fin::String, ambs::Vector{Amb})
             df = DataFrame( (index = a.index, stationIndex = a.stationIndex, intClass = a.intClass, class=a.class) for a in ambs)
             CSV.write(fin, df) 
end

```

It works earlier, but gave an error message, saying `ArgumentError: unable to construct DataFrame from Base.Generator{Array{Amb,1}}`

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [August 29, 2019, 5:45am UTC](https://discourse.julialang.org/t/very-strange-can-not-create-a-data-frame-with-the-following-simple-example/28147/2 "2019-08-29T05:45:43Z")

</div>

Please provide a minimal working example. We do not know what Amb actually is.
