cardillo / joinery

Data frames for Java
https://joinery.sh
GNU General Public License v3.0
697 stars 167 forks source link

Export to CSV does not write row names #51

Open darkoc opened 8 years ago

darkoc commented 8 years ago

The Serialization.<V>writeCsv(final DataFrame<V> df, final OutputStream output) method doesn't write the row names if dfis a dataframe which has row names.

cardillo commented 8 years ago

So, turns out this writing the index is not supported by the csv library joinery uses. There is a workaround, you can add the index as a new column prior to writing the csv file:

df.add("labels", df.index()).writeCsv(...)

donggua223344 commented 2 years ago

Hi, can you assign this issue to me?

rfraser3 commented 2 years ago

We should have this completed in the near future

rfraser3 commented 2 years ago

As a heads up, the proposed solution above does not work. It adds the entire index name and all values to the single cell where the column header should be.