Documentation
¶
Index ¶
- func LoadCSV(filename string, options CSVOptions) (types.Matrix, []string, error)
- func ReadCSV(r io.Reader, options CSVOptions) (types.Matrix, []string, error)
- func SaveCSV(filename string, data types.Matrix, headers []string, options CSVOptions) error
- func WriteCSV(w io.Writer, data types.Matrix, headers []string, options CSVOptions) error
- type CSVOptions
- type DataInfo
- type StreamingReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CSVOptions ¶
type CSVOptions struct {
Delimiter rune
HasHeader bool
SkipRows int
MaxRows int // 0 for unlimited
Columns []int // Specific columns to read, empty for all
NullValues []string // Strings to treat as NaN
StreamingMode bool // For large files
}
CSVOptions contains configuration for CSV reading/writing
func DefaultCSVOptions ¶
func DefaultCSVOptions() CSVOptions
DefaultCSVOptions returns default CSV options
type DataInfo ¶
type DataInfo struct {
Rows int
Columns int
Headers []string
HasMissing bool
MissingCount int
DataTypes []string // inferred types per column
}
DataInfo provides information about a dataset
func InspectCSV ¶
func InspectCSV(filename string, options CSVOptions) (*DataInfo, error)
InspectCSV provides information about a CSV file without loading all data
type StreamingReader ¶
type StreamingReader struct {
// contains filtered or unexported fields
}
StreamingReader provides memory-efficient reading of large CSV files
func NewStreamingReader ¶
func NewStreamingReader(filename string, options CSVOptions) (*StreamingReader, error)
NewStreamingReader creates a new streaming CSV reader
func (*StreamingReader) Close ¶
func (sr *StreamingReader) Close() error
Close closes the underlying file
func (*StreamingReader) Headers ¶
func (sr *StreamingReader) Headers() []string
Headers returns the column headers if available
func (*StreamingReader) Next ¶
func (sr *StreamingReader) Next() ([]float64, error)
Next reads the next row from the CSV file
Click to show internal directories.
Click to hide internal directories.