go-gota / gota

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

[Question] Does series.go support a method for checking if any value in column contains string? #150

Closed regulardude400 closed 3 years ago

regulardude400 commented 3 years ago

I looked at the supported comparators here: https://github.com/go-gota/gota/blob/d8f1f578e815b4c252eeed30db80bcd271c7d92c/series/series.go#L95 and it seems that it currently doesn't support a contains method.

I am trying to do the following operation as vector-like without iteration: new_column := df.Filter( dataframe.F{"ColA", series.Contains, "value1"}, dataframe.F{"ColA", series.Contains, "value2"}, )

Is there a workaround or alternative way to solve this without iteration. Else I can just iterate over the rows and columns but performance may take a hit in our application.

Thanks for the work all the contributing devs have done so far.

Edit: It seems that I can use a combination of the df.Capply(func) to get the job done.