pd

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2019 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

Package pd (aka GoPandas) is a library for cleaning, manipulating, and reshaping 2-dimensional data from a spreadsheet or table. GoPandas combines a flexibile API familiar to Python pandas users with the strengths of Go, including type safety, predictable error handling, and concurrent processing.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataFrame

func DataFrame(data []interface{}, config ...Config) (*dataframe.DataFrame, error)

DataFrame constructs a new DataFrame.

Example (Default)
df, _ := DataFrame([]interface{}{[]string{"foo", "bar", "baz"}, []int{7, 11, 19}})
fmt.Println(df)
Output:

       0   1
0    foo   7
1    bar  11
2    baz  19

func ReadCSV

func ReadCSV(path string, config ...ReadOptions) (*dataframe.DataFrame, error)

ReadCSV converts a CSV file into a DataFrame.

func ReadInterface

func ReadInterface(input [][]interface{}, config ...ReadOptions) (*dataframe.DataFrame, error)

ReadInterface converts [][]interface{}{row1{col1, ...}...} into a DataFrame

func Series

func Series(data interface{}, config ...Config) (*series.Series, error)

Series constructs a new Series.

Example (DefaultIndex)
s, _ := Series([]string{"foo", "bar", "baz"})
fmt.Println(s)
Output:

0    foo
1    bar
2    baz

datatype: string

Types

type Config

type Config struct {
	Name            string
	DataType        options.DataType
	Index           interface{}
	IndexName       string
	MultiIndex      []interface{}
	MultiIndexNames []string
	Col             []string
	ColName         string
	MultiCol        [][]string
	MultiColNames   []string
	Manual          bool
}

Config customizes the construction of either a DataFrame or Series.

type ReadOptions

type ReadOptions struct {
	DropRows        int
	HeaderRows      int
	IndexCols       int
	Manual          bool
	DataTypes       map[string]string
	IndexDataTypes  map[int]string
	ColumnDataTypes map[int]string
	Rename          map[string]string
}

ReadOptions are options for reading in files from other formats

Directories

Path Synopsis
benchmarking
profiler command
Package dataframe defines the DataFrame, a 2-dimensional data structure with an n-level index, n-level column headers, and columns of typed data.
Package dataframe defines the DataFrame, a 2-dimensional data structure with an n-level index, n-level column headers, and columns of typed data.
internal
index
Package index is an internal collection of data structures and methods for constructing and modifying n-level indexes and column headers.
Package index is an internal collection of data structures and methods for constructing and modifying n-level indexes and column headers.
values
Package values is an internal package that powers the values within pd/Series and pd/DataFrame.
Package values is an internal package that powers the values within pd/Series and pd/DataFrame.
Package options defines custom DataTypes and settable options for use in constructing, modifying, and displaying DataFrames and Series.
Package options defines custom DataTypes and settable options for use in constructing, modifying, and displaying DataFrames and Series.
Package series defines the Series, a typed 1-dimensional data structure with an n-level index, analogous to a column in a spreadsheet.
Package series defines the Series, a typed 1-dimensional data structure with an n-level index, analogous to a column in a spreadsheet.

Jump to

Keyboard shortcuts

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