Documentation ¶
Index ¶
- func Float64Seq(start, end, step float64, max ...int) []float64
- func Int64Seq(start, end, step int64, max ...int) []int64
- func IntSeq(start, end, step int, max ...int) []int
- func Reverse(ctx context.Context, sdf common, opts ...ReverseOptions) error
- func Search(ctx context.Context, s dataframe.Series, lower, upper interface{}, ...) ([]int, error)
- func Shuffle(ctx context.Context, sdf common, opts ...ShuffleOptions) (rErr error)
- type ReverseOptions
- type SearchOptions
- type ShuffleOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Float64Seq ¶
Float64Seq will return a sequence of float64 values starting at start.
func Reverse ¶
func Reverse(ctx context.Context, sdf common, opts ...ReverseOptions) error
Reverse will reverse the order of a Dataframe or Series. If a Range is provided, only the rows within the range are reversed. s will be locked for the duration of the operation.
func Search ¶
func Search(ctx context.Context, s dataframe.Series, lower, upper interface{}, opts ...SearchOptions) ([]int, error)
Search is used to find particular values in a given Series. It will find all values that are between lower and upper bounds (inclusive). It will return a slice containing the rows which contain values within the bounds. If Search is canceled, an incomplete list of the rows "found so far" is returned. s will be locked for the duration of the operation.
Example:
s1 := dataframe.NewSeriesInt64("", nil, 11, 10, 9, 8, 7, 6, 5, 23, 25, 2, 1, 5, 4) fmt.Println(utils.Search(ctx, s1, int64(4), int64(6))) // Output: [5 6 11 12]
Types ¶
type ReverseOptions ¶
type ReverseOptions struct { // R is used to limit the range of the Series for search purposes. R *dataframe.Range // DontLock can be set to true if the Series should not be locked. DontLock bool }
ReverseOptions modifies the behavior of Reverse.
type SearchOptions ¶
type SearchOptions struct { // Max is used to stop the search after it finds Max number of results. // When Max is set to nil (or 0), all results are sought. Max *int // NoConcurrency can be set to ensure that results are stable (& reproducible). // This can be useful if the context is canceled or a Max is set. NoConcurrency bool // R is used to limit the range of the Series for search purposes. R *dataframe.Range // DontLock can be set to true if the Series should not be locked. DontLock bool }
SearchOptions modifies the behavior of Search.
type ShuffleOptions ¶
type ShuffleOptions struct { // R is used to limit the range of the Series for search purposes. R *dataframe.Range // DontLock can be set to true if the Series should not be locked. DontLock bool }
ShuffleOptions modifies the behavior of Shuffle.