exports

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportToCSV

func ExportToCSV(ctx context.Context, w io.Writer, df *dataframe.DataFrame, options ...CSVExportOptions) error

ExportToCSV exports a Dataframe to a CSV file.

func ExportToExcel

func ExportToExcel(ctx context.Context, w io.Writer, df *dataframe.DataFrame, options ...ExcelExportOptions) error

ExportToExcel exports a Dataframe to an excel file.

func ExportToJSON

func ExportToJSON(ctx context.Context, w io.Writer, df *dataframe.DataFrame, options ...JSONExportOptions) error

ExportToJSON exports a Dataframe in the jsonl format. Each line represents a row from the Dataframe.

See: http://jsonlines.org/ for more information.

func ExportToParquet

func ExportToParquet(ctx context.Context, w io.Writer, df *dataframe.DataFrame, options ...ParquetExportOptions) error

ExportToParquet exports a Dataframe as a Parquet file. Series names are escaped by replacing spaces with underscores and removing ",;{}()=" (excluding quotes) and then lower-casing for maximum cross-compatibility.

Types

type CSVExportOptions

type CSVExportOptions struct {

	// NullString is used to set what nil values should be encoded to.
	// Common options are NULL, \N, NaN, NA.
	NullString *string

	// Range is used to export a subset of rows from the dataframe.
	Range dataframe.Range

	// Separator is the field delimiter. A common option is ',', which is
	// the default if CSVExportOptions is not provided.
	Separator rune

	// UseCRLF determines the line terminator.
	// When true, it is set to \r\n.
	UseCRLF bool
}

CSVExportOptions contains options for ExportToCSV function.

type ExcelExportOptions

type ExcelExportOptions struct {

	// NullString is used to set what nil values should be encoded to.
	// Common options are NULL, \N, NaN, NA.
	NullString *string

	// Range is used to export a subset of rows from the Dataframe.
	Range dataframe.Range

	// WriteSheet is used to specify a sheet name.
	// When not set, it defaults to "sheet1"
	WriteSheet *string
}

ExcelExportOptions contains options for ExportToExcel function.

type JSONExportOptions

type JSONExportOptions struct {

	// NullString is used to set what nil values should be encoded to.
	// Common options are strings: NULL, \N, NaN, NA.
	// If not set, then null (non-string) is used.
	NullString *string

	// Range is used to export a subset of rows from the Dataframe.
	Range dataframe.Range

	// SetEscapeHTML specifies whether problematic HTML characters should be escaped inside JSON quoted strings.
	// See: https://golang.org/pkg/encoding/json/#Encoder.SetEscapeHTML
	SetEscapeHTML bool
}

JSONExportOptions contains options for ExportToJSON function.

type ParquetExportOptions

type ParquetExportOptions struct {

	// Range is used to export a subset of rows from the dataframe.
	Range dataframe.Range

	// PageSize defaults to 8K if not set set.
	//
	// See: https://godoc.org/github.com/xitongsys/parquet-go/writer#ParquetWriter
	PageSize *int64

	// CompressionType defaults to CompressionCodec_SNAPPY if not set.
	//
	// See: https://godoc.org/github.com/xitongsys/parquet-go/writer#ParquetWriter
	CompressionType *parquet.CompressionCodec

	// Offset defaults to 4 if not set.
	//
	// See: https://godoc.org/github.com/xitongsys/parquet-go/writer#ParquetWriter
	Offset *int64
}

ParquetExportOptions contains options for ExportToParquet function.

Jump to

Keyboard shortcuts

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