framian icon indicating copy to clipboard operation
framian copied to clipboard

Save a Frame to CSV

Open darrenjw opened this issue 9 years ago • 3 comments

Perhaps I missed it, but I couldn't see an easy way to do this. It would obviously be very useful.

darrenjw avatar Jun 03 '15 13:06 darrenjw

I've been playing some more with this, and came up with the following, for converting a Frame, df:

Csv.fromFrame(new CsvFormat(",", header = true))(df).toString

which seems as though it ought to work. However, there's a problem with it. The initial header row is output with field names in the same order that they occur in the Frame. However, the actual data rows for some frames have their elements ordered differently to the order in which they occur in the data frame. The result is then a mismatch between the ordering of the header items and the data items, which is obviously a bad thing.

Is this a bug in the library somewhere?

darrenjw avatar Jun 14 '15 19:06 darrenjw

I have seen the same issue, but I could not narrow down where the bug is occurring. It's interesting because calling .toString on the Frame does not result in the same error.

dwhitney avatar Jul 23 '15 13:07 dwhitney

Interesting - I suspect we are using the wrong index iteration order somewhere... I'll check it out

tixxit avatar Jul 23 '15 13:07 tixxit