go-gota / gota

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

Does there exist a way, or a plan to provide appending new data? #69

Open helloworldpark opened 6 years ago

helloworldpark commented 6 years ago

Having a look at the godoc, I couldn't find any API to add a new data, i.e. a new row, to the existing Dataframe. Is it planned to be implemented, or is there a hack to deal with?

nawa commented 6 years ago

Is it what you require? https://github.com/kniren/gota/issues/62

df = df.RBind( dataframe.LoadRecords(
        [][]string{
            []string{"A", "B", "C", "D"},
            []string{"z", "9", "9.9", "true"},
        },
    )
)
pjebs commented 6 years ago

Append to a certain index, not necessarily to the end.

mannharleen commented 4 years ago

@helloworldpark @nawa I ve created a PR with the relevant changes that would implement an insert at arbitrary position. Happy for feedback. If in doubt, checkout the tests for usage