go-gota / gota

Gota: DataFrames and data wrangling in Go (Golang)
Other
2.97k stars 276 forks source link

Support list type as series' element #178

Open ariefrahmansyah opened 2 years ago

ariefrahmansyah commented 2 years ago

Currently, gota only supports four basic types (bool, float, int, string) but not for list types ([]bool, []float, []int, []string).

Any plan to support list types?

Example:

    df := dataframe.New(
        series.New([]string{"b", "a"}, series.String, "COL.1"),
        series.New([]int{1, 2}, series.Int, "COL.2"),
        series.New([]float64{3.0, 4.0}, series.Float, "COL.3"),
        series.New([][]int{{1, 2}, {3, 4}}, series.IntList, "COL.4"),
    )
    fmt.Println(df)

    // Output:
    // [2x4] DataFrame
    //
    //     COL.1    COL.2 COL.3    COL.4
    //  0: b        1     3.000000 [1 2]
    //  1: a        2     4.000000 [3 4]
    //     <string> <int> <float>  <int_list>

It's related to https://github.com/go-gota/gota/issues/102