Skip to content

Instantly share code, notes, and snippets.

@andrewclegg
Created July 1, 2016 11:19
Show Gist options
  • Save andrewclegg/702305339ac58be604ff1788af9a95ff to your computer and use it in GitHub Desktop.
Save andrewclegg/702305339ac58be604ff1788af9a95ff to your computer and use it in GitHub Desktop.
import java.io.File
import org.canova.api.records.writer.impl.CSVRecordWriter
import org.canova.common.RecordConverter
import org.nd4j.linalg.factory.Nd4j
object CsvExample extends App {
val nd4j = Nd4j.factory()
val outputWriter = new CSVRecordWriter(new File("example.csv"))
val output = nd4j.rand(1, 10)
println(output)
outputWriter.write(RecordConverter.toRecord(output))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment