csv

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package csv provides functionality for reading and writing CSV data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SomToCsv

func SomToCsv(som *som.Som, writer io.Writer, delim rune, noData string) error

SomToCsv writes the weights of the SOM's nodes to a CSV file. Categorical layers are converted back to their string representations.

func TableToCSV

func TableToCSV(t *table.Table, writer io.Writer, sep rune, noData string) error

TableToCSV writes the contents of the given table.Table to the provided io.Writer in CSV format, using the specified separator rune and noData string to represent NaN values.

func TablesToCsv

func TablesToCsv(tables []*table.Table, labelColumns []string, labels [][]string, writer io.Writer, delim rune, noData string) error

TablesToCsv writes the contents of the given tables and labels to the provided io.Writer in CSV format, using the specified delimiter rune and noData string to represent NaN values. The labelColumns parameter specifies the column names for the label columns. The labels parameter provides the label values for each label column. The tables parameter provides the data tables to be written to the CSV. Label columns are written first, followed by data table columns.

Types

type FileReader

type FileReader struct {
	// contains filtered or unexported fields
}

FileReader is an implementation of table.Reader that reads data from a CSV file.

func NewFileReader

func NewFileReader(path string, delim rune, noData string) (*FileReader, error)

func (*FileReader) NoData added in v0.2.0

func (f *FileReader) NoData() string

func (*FileReader) ReadColumns

func (f *FileReader) ReadColumns(columns []string) (*table.Table, error)

func (*FileReader) ReadLabels

func (f *FileReader) ReadLabels(column string) ([]string, error)

type StringReader

type StringReader struct {
	// contains filtered or unexported fields
}

StringReader an implementation of table.Reader that uses a CSV string as source.

func NewStringReader

func NewStringReader(text string, delim rune, noData string) *StringReader

func (*StringReader) NoData added in v0.2.0

func (s *StringReader) NoData() string

func (*StringReader) ReadColumns

func (s *StringReader) ReadColumns(columns []string) (*table.Table, error)

func (*StringReader) ReadLabels

func (s *StringReader) ReadLabels(column string) ([]string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL