Skip to content

kevinmtanadi/godf

Repository files navigation

godf

Go Reference

A simple dataframe handler for golang, inspired by pandas from python. I used @jedib0t's go-pretty to render the table.

It can handle simple data manipulation such as :

  • One hot encoding
  • Sorting
  • Shuffling data
  • Filtering

Install

go get -u github.com/kevinmtanadi/godf

Usage

Basic Usage

x := []float64{0.1, 0.2, 0.3, 0.4, 0.5}
y := []float64{1.1, 1.2, 1.3, 1.4, 1.5}
z := []float64{21, 22, 23, 24, 25}

df := godf.DataFrame(map[string]interface{}{
  "x": x,
  "y": y,
  "z": z,
})

df.Show()
┌───┬─────┬─────┬────┐
│ # │   X │   Y │  Z │
├───┼─────┼─────┼────┤
│ 1 │ 0.1 │ 1.1 │ 21 │
│ 2 │ 0.2 │ 1.2 │ 22 │
│ 3 │ 0.3 │ 1.3 │ 23 │
│ 4 │ 0.4 │ 1.4 │ 24 │
│ 5 │ 0.5 │ 1.5 │ 25 │
└───┴─────┴─────┴────┘

Read CSV File

df := godf.ReadCSV("data.csv")

df.Show()

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages