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

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

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}}

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

1 Like