A library like python pandas for golang base on 1.18. Provide DataFrame and Series. Supports read from xlsx, csv, parquet and export to xlsx, csv, parquet.
package main
import (
"fmt"
"github.com/tanyaofei/pandat"
)
func main() {
// Create dataframe
df := pandat.NewDataFrame(
pandat.NewSeries("a", 1, 2, 3, 4, 5),
pandat.NewSeries("b", 2, 3, 4, 5, 6),
)
fmt.Println(df)
// read from csv
dfFromCSV, _ := pandat.ReadCsvPath("example.csv", pandat.ReadCsvOption{})
fmt.Println(dfFromCSV)
// read from xlsx
dfFromXlsx, _ := pandat.ReadXlsxPath("1.xlsx", pandat.ReadXlsxOption{})
fmt.Println(dfFromXlsx)
// read from parquet
dfFromParquet, _ := pandat.ReadParquetPath("1.parquet")
fmt.Println(dfFromParquet)
}
package main
import "github.com/tanyaofei/pandat"
func main() {
df := pandat.NewDataFrame(
pandat.NewSeries("a", 1, 2, 3, 4, 5),
pandat.NewSeries("b", 2, 3, 4, 5, 6),
)
df.ToParquetPath("1.parquet")
df.ToCsvPath("1.csv", pandat.WriteCSVOption{})
df.ToXlsxPath("1.xlsx", pandat.WriteXlsxOption{})
}
- Supports sav, zsav
- More stats
- formatted printing for dataframe