Documentation ¶
Index ¶
- Variables
- func DefaultOptions[T any](o ...T) T
- func DefaultValueFormatter(v interface{}) string
- func IsEqualDefaultFunc[T any](f1, f2 T) bool
- func IsEqualFunc[T comparable](f1, f2 T) bool
- func IsEqualPtrFunc[T comparable](f1, f2 *T) bool
- func IsLessThanFunc[T constraints.Ordered](f1, f2 T) bool
- func IsLessThanPtrFunc[T constraints.Ordered](f1, f2 *T) bool
- type ApplyDataFrameFn
- type ApplyOptions
- type ApplySeriesFn
- type CompareFn
- type DataFrame
- func (df *DataFrame) AddSeries(s SeriesAny, colN *int, options ...Options) error
- func (df *DataFrame) Append(vals any, options ...Options)
- func (df *DataFrame) Apply(ctx context.Context, fn ApplyDataFrameFn, options ...ApplyOptions) (*DataFrame, error)
- func (df *DataFrame) Copy(options ...RangeOptions) *DataFrame
- func (df *DataFrame) FillRand(rnd RandFn[any])
- func (df *DataFrame) Filter(ctx context.Context, fn FilterDataFrameFn, options ...FilterOptions) (*DataFrame, error)
- func (df *DataFrame) Insert(row int, vals any, options ...Options)
- func (df *DataFrame) IsEqual(ctx context.Context, df2 *DataFrame, options ...IsEqualOptions) (bool, error)
- func (s *DataFrame) Iterator(options ...IteratorOptions) Iterator[map[string]any]
- func (df *DataFrame) Lock(deep ...bool)
- func (df *DataFrame) MustNameToColumn(seriesName string, options ...Options) int
- func (df *DataFrame) NRows(options ...Options) int
- func (df *DataFrame) NameToColumn(seriesName string, options ...Options) (int, error)
- func (df *DataFrame) Names(options ...Options) []string
- func (df *DataFrame) Prepend(vals any, options ...Options)
- func (df *DataFrame) RLock(deep ...bool)
- func (df *DataFrame) RUnlock(deep ...bool)
- func (df *DataFrame) Remove(row int, options ...Options)
- func (df *DataFrame) RemoveSeries(seriesName string, options ...Options) error
- func (df *DataFrame) ReorderColumns(newOrder []string, options ...Options) error
- func (df *DataFrame) Row(row int, options ...Options) map[string]any
- func (df *DataFrame) Sort(ctx context.Context, keys []SortKey, options ...SortOptions) (completed bool)
- func (df *DataFrame) String() string
- func (df *DataFrame) Swap(row1, row2 int, options ...Options)
- func (df *DataFrame) Table(options ...TableOptions) string
- func (df *DataFrame) Unlock(deep ...bool)
- func (df *DataFrame) Update(row int, col any, val any, options ...Options)
- func (df *DataFrame) UpdateRow(row int, vals any, options ...Options)
- type FilterAction
- type FilterDataFrameFn
- type FilterOptions
- type FilterSeriesFn
- type IsEqualOptions
- type Iterator
- type IteratorFn
- type IteratorOptions
- type Options
- type RandFn
- type RangeOptions
- type Series
- func ApplySeries[T any](ctx context.Context, s *Series[T], fn ApplySeriesFn[T], ...) (*Series[T], error)
- func FilterSeries[T any](ctx context.Context, s *Series[T], fn FilterSeriesFn[T], ...) (*Series[T], error)
- func GetSeries[T any, U int | string](df *DataFrame, name U) *Series[T]
- func NewSeries[T any](name string, init *SeriesInit, vals ...T) *Series[T]
- func (s *Series[T]) Append(val []T, options ...Options) int
- func (s *Series[T]) AppendAny(val any, options ...Options) int
- func (s *Series[T]) Apply(ctx context.Context, fn ApplySeriesFn[T], options ...ApplyOptions) (*Series[T], error)
- func (s *Series[T]) Copy(options ...RangeOptions) *Series[T]
- func (s *Series[T]) CopyAny(options ...RangeOptions) SeriesAny
- func (s *Series[T]) FillRand(rnd RandFn[T])
- func (s *Series[T]) FillRandAny(rnd RandFn[any])
- func (s *Series[T]) Filter(ctx context.Context, fn FilterSeriesFn[T], options ...FilterOptions) (*Series[T], error)
- func (s *Series[T]) Insert(row int, val []T, options ...Options)
- func (s *Series[T]) InsertAny(row int, val any, options ...Options)
- func (s *Series[T]) IsEqual(ctx context.Context, s2 *Series[T], options ...IsEqualOptions) (bool, error)
- func (s *Series[T]) IsEqualAny(ctx context.Context, s2 SeriesAny, options ...IsEqualOptions) (bool, error)
- func (s *Series[T]) IsEqualAnyFunc(a, b any) bool
- func (s *Series[T]) IsEqualFunc(a, b T) bool
- func (s *Series[T]) IsLessThanAnyFunc(a, b any) bool
- func (s *Series[T]) IsLessThanFunc(a, b T) bool
- func (s *Series[T]) Iterator(options ...IteratorOptions) Iterator[T]
- func (s *Series[T]) IteratorAny(options ...IteratorOptions) Iterator[any]
- func (s *Series[T]) NRows(options ...Options) int
- func (s *Series[T]) Name(options ...Options) string
- func (s *Series[T]) Prepend(val []T, options ...Options)
- func (s *Series[T]) PrependAny(val any, options ...Options)
- func (s *Series[T]) Remove(row int, options ...Options)
- func (s *Series[T]) Rename(n string, options ...Options)
- func (s *Series[T]) Reset(options ...Options)
- func (s *Series[T]) SetIsEqualAnyFunc(f CompareFn[any])
- func (s *Series[T]) SetIsEqualFunc(f CompareFn[T])
- func (s *Series[T]) SetIsLessThanAnyFunc(f CompareFn[any])
- func (s *Series[T]) SetIsLessThanFunc(f CompareFn[T])
- func (s *Series[T]) SetValueToStringFormatter(f ValueToStringFormatter)
- func (s *Series[T]) Sort(ctx context.Context, options ...SortOptions) (completed bool)
- func (s *Series[T]) String() string
- func (s *Series[T]) Swap(row1, row2 int, options ...Options)
- func (s *Series[T]) Table(options ...TableOptions) string
- func (s *Series[T]) Type() string
- func (s *Series[T]) Update(row int, val T, options ...Options)
- func (s *Series[T]) UpdateAny(row int, val any, options ...Options)
- func (s *Series[T]) Value(row int, options ...Options) T
- func (s *Series[T]) ValueAny(row int, options ...Options) any
- func (s *Series[T]) ValueString(row int, options ...Options) string
- type SeriesAny
- type SeriesInit
- type SortKey
- type SortOptions
- type TableOptions
- type ValueToStringFormatter
Constants ¶
This section is empty.
Variables ¶
var DontLock = dontLock
shortcut for Options { DontLock: true }
Functions ¶
func DefaultOptions ¶
func DefaultOptions[T any](o ...T) T
DefaultOptions is helper function to resolve variadic options.
func DefaultValueFormatter ¶
func DefaultValueFormatter(v interface{}) string
DefaultValueFormatter will return a string representation of the data in a particular row.
func IsEqualDefaultFunc ¶
IsEqualDefaultFunc provides comparaision for any type
func IsEqualFunc ¶
func IsEqualFunc[T comparable](f1, f2 T) bool
IsEqualFunc provides basic comparison for comparable types
func IsEqualPtrFunc ¶
func IsEqualPtrFunc[T comparable](f1, f2 *T) bool
IsEqualPtrFunc provides comparision for pointers of comparable types
func IsLessThanFunc ¶
func IsLessThanFunc[T constraints.Ordered](f1, f2 T) bool
IsLessThanFunc provides (less than) comparision for Ordered types
func IsLessThanPtrFunc ¶
func IsLessThanPtrFunc[T constraints.Ordered](f1, f2 *T) bool
IsLessThanPtrFunc provides (less than) comparision for pointers of Ordered types
Types ¶
type ApplyDataFrameFn ¶
ApplyDataFrameFn is used by the Apply function when used with DataFrames. vals contains the values for the current row. The keys contain ints (index of Series) and strings (name of Series). The returned map must only contain what values you intend to update. The key can be a string (name of Series) or int (index of Series). If nil is returned, the existing values for the row are unchanged.
type ApplyOptions ¶
type ApplyOptions = FilterOptions
ApplyOptions is defined as an optional parameters for Apply(...) on top of Series or DataFrame.
Defaults:
ApplyOptions { InPlace: false, DontLock: false }
Properties:
- `InPlace` - Apply affects current Series/DataFrame and no new one is returned
- `DontLock` - if set to true, then operation is performed without locking RWMutex
type ApplySeriesFn ¶
ApplySeriesFn is used by the Apply function when used with Series. val contains the value of the current row. The returned value is the updated value.
type DataFrame ¶
type DataFrame struct { Series []SeriesAny // contains filtered or unexported fields }
DataFrame allows you to handle numerous series of data conveniently.
func ApplyDataFrame ¶
func ApplyDataFrame(ctx context.Context, df *DataFrame, fn ApplyDataFrameFn, options ...ApplyOptions) (*DataFrame, error)
ApplyDataFrame applies function to DataFrame. If ApplyOptions are set as `ApplyOptions { InPlace: true }` then dataframe is modified, otherwise new dataframe is returned.
func FilterDataFrame ¶
func FilterDataFrame(ctx context.Context, df *DataFrame, fn FilterDataFrameFn, options ...FilterOptions) (*DataFrame, error)
FilterDataFrame applies filter function to DataFrame. If FilterOptions are set as `FilterOptions { InPlace: true }` then dataframe is modified, otherwise new dataframe is returned.
func NewDataFrame ¶
NewDataFrame creates a dataframe from passed series.
Example:
x := NewSeries[float64]("x", nil, 1, 2, 3) y := NewSeries("y", nil, 1., 2., 3.) df := NewDataFrame(x, y)
func (*DataFrame) AddSeries ¶
AddSeries will add a Series to the end of the DataFrame, unless set by ColN.
func (*DataFrame) Apply ¶
func (df *DataFrame) Apply(ctx context.Context, fn ApplyDataFrameFn, options ...ApplyOptions) (*DataFrame, error)
Apply applies function to DataFrame. If ApplyOptions are set as `ApplyOptions { InPlace: true }` then dataframe is modified, otherwise new dataframe is returned.
func (*DataFrame) Copy ¶
func (df *DataFrame) Copy(options ...RangeOptions) *DataFrame
Copy will create a new copy of the Dataframe. It is recommended that you lock the Dataframe before attempting to Copy.
func (*DataFrame) Filter ¶
func (df *DataFrame) Filter(ctx context.Context, fn FilterDataFrameFn, options ...FilterOptions) (*DataFrame, error)
Filter applies filter function to DataFrame. If FilterOptions are set as `FilterOptions { InPlace: true }` then dataframe is modified, otherwise new dataframe is returned.
func (*DataFrame) IsEqual ¶
func (df *DataFrame) IsEqual(ctx context.Context, df2 *DataFrame, options ...IsEqualOptions) (bool, error)
IsEqual returns true if df2's values are equal to df.
func (*DataFrame) Iterator ¶
func (s *DataFrame) Iterator(options ...IteratorOptions) Iterator[map[string]any]
Iterator will return a function that can be used to iterate through all the values.
func (*DataFrame) Lock ¶
Lock will lock the Dataframe allowing you to directly manipulate the underlying Series with confidence.
func (*DataFrame) MustNameToColumn ¶
MustNameToColumn returns the index of the series based on the name. The starting index is 0. If seriesName doesn't exist it panics.
func (*DataFrame) NRows ¶
NRows returns the number of rows of data. Each series must contain the same number of rows.
func (*DataFrame) NameToColumn ¶
NameToColumn returns the index of the series based on the name. The starting index is 0.
func (*DataFrame) RLock ¶
Lock will lock the Dataframe allowing you to directly manipulate the underlying Series with confidence.
func (*DataFrame) RemoveSeries ¶
RemoveSeries will remove a Series from the Dataframe.
func (*DataFrame) ReorderColumns ¶
ReorderColumns reorders the columns based on an ordered list of column names. The length of newOrder must match the number of columns in the Dataframe. The column names in newOrder must be unique.
func (*DataFrame) Sort ¶
func (df *DataFrame) Sort(ctx context.Context, keys []SortKey, options ...SortOptions) (completed bool)
Sort is used to sort the Dataframe according to different keys. It will return true if sorting was completed or false when the context is canceled.
func (*DataFrame) String ¶
String implements the fmt.Stringer interface. It does not lock the DataFrame.
func (*DataFrame) Table ¶
func (df *DataFrame) Table(options ...TableOptions) string
Table will produce the DataFrame in a table.
type FilterAction ¶
type FilterAction int
FilterAction is the return value of FilterSeriesFn and FilterDataFrameFn.
const ( // DROP is used to signify that a row must be dropped. DROP FilterAction = 0 // KEEP is used to signify that a row must be kept. KEEP FilterAction = 1 // CHOOSE is used to signify that a row must be kept. CHOOSE FilterAction = 1 )
type FilterDataFrameFn ¶
type FilterDataFrameFn func(vals map[string]any, row, nRows int) (FilterAction, error)
FilterDataFrameFn is used by the Filter function to determine which rows are selected. vals contains the values for the current row. The keys contain ints (index of Series) and strings (name of Series). If the function returns DROP, then the row is removed. If KEEP or CHOOSE is chosen, the row is kept.
type FilterOptions ¶
type FilterOptions struct {
InPlace, DontLock bool
}
FilterOptions is defined as an optional parameters for Filter(...) on top of Series or DataFrame.
Defaults:
FilterOptions { InPlace: false, DontLock: false }
Properties:
- `InPlace` - Filter affects current Series/DataFrame and no new one is returned
- `DontLock` - if set to true, then operation is performed without locking RWMutex
type FilterSeriesFn ¶
type FilterSeriesFn[T any] func(val T, row, nRows int) (FilterAction, error)
FilterSeriesFn is used by the Filter function to determine which rows are selected. val contains the value of the current row. If the function returns DROP, then the row is removed. If KEEP or CHOOSE is chosen, the row is kept.
type IsEqualOptions ¶
type IsEqualOptions struct {
CheckName, DontLock bool
}
IsEqualOptions is defined as an optional parameters for IsEqual(...) on top of Series or DataFrame.
Defaults:
IsEqualOptions { CheckName: false, DontLock: false }
Properties:
- `CheckName` - indicates that name should be checked in form of equality
- `DontLock` - if set to true, then operation is performed without locking RWMutex
type Iterator ¶
Iterator is an structure for iterating Series or DataFrames. When `Next()` is called, new Index and Value is filled until `notDone` is true.
func NewIterator ¶
func NewIterator[T any](iterator IteratorFn[T]) Iterator[T]
NewIterator creates Iterator instance with iterator function of type `IteratorFn[T any]`. Iterator function is called with `iterator.Next()`
type IteratorFn ¶
Iterator function returns actual row, value for that row, total number of elements and "not done" flag
type IteratorOptions ¶
SortOptions is defined as an optional parameters for Iterator(...) on top of Series or DataFrame.
Defaults:
IteratorOptions { InitialRow: 0, Step: 1, DontLock: false }
Properties:
- `InitialRow` - if set then iterator will start at this row.
- `Step` - iteration step. Negative values causes backward iterations
- `DontLock` - if set to true, then operation is performed without locking RWMutex
type Options ¶
type Options struct {
DontLock bool
}
Options is used to perform operation with DontLock. Notice that all operations on the series or dataframes are performed with locked RWMutex.
Defaults:
Options { DontLock: false }
Properties:
- `DontLock` - if set to true, then operation is performed without locking RWMutex
type RandFn ¶
type RandFn[T any] func() T
func RandFillerFloat64 ¶
RandFillerFloat64 is helper function to fill data of *Series[float64] randomly. probNil is an optional parameter which indicates probability of NaN value as a return.
type RangeOptions ¶
RangeOptions is defined as an optional parameters for functions which needs range like Copy(...), Apply(...), Filter(...), etc.
Notice that DataFrame and Series calls Limits(length) on top of RangeOptions passed. In case of `r.End == nil`, end is set to -1. Negative values provides indexing from the end. For example the Range(0, -1) is the same as Range(0, len(arr) - 1)
Defaults:
RangeOptions { Start: 0, End: nil }
Properties:
- `Start` - Defines start row/index for iteration/copy
- `End` - Defines where iteration/copy should end
func Range ¶
func Range(r ...int) RangeOptions
Range is helper function for creating RangeOptions.
Example:
r1 := Range(0, 10) // Equivalent to RangeOptions { Start: 0, End: &[]int { 10 }[0]} r2 := Range(10) // Equivalent to RangeOptions { Start: 10 }
type Series ¶
type Series[T any] struct { // Values is exported to better improve interoperability with the gonum package. // // See: https://godoc.org/gonum.org/v1/gonum // // WARNING: Do not modify directly. Values []T sync.RWMutex // contains filtered or unexported fields }
func ApplySeries ¶
func ApplySeries[T any](ctx context.Context, s *Series[T], fn ApplySeriesFn[T], options ...ApplyOptions) (*Series[T], error)
ApplySeries applies filter function to series. If ApplyOptions are set as `ApplyOptions { InPlace: true }` then series is modified, otherwise new series is returned.
func FilterSeries ¶
func FilterSeries[T any](ctx context.Context, s *Series[T], fn FilterSeriesFn[T], options ...FilterOptions) (*Series[T], error)
FilterSeries applies filter function to series. If FilterOptions are set as `FilterOptions { InPlace: true }` then series is modified, otherwise new series is returned.
func NewSeries ¶
func NewSeries[T any](name string, init *SeriesInit, vals ...T) *Series[T]
NewSeries creates a series of type T with defined name. Size of the series can be prealocated by passing `init`. Series can also by filled by data passed as vals.
Example:
x := NewSeries[float64]("x", nil, 1, 2, 3) y := NewSeries("y", nil, 1., 2., 3.)
func (*Series[T]) Apply ¶
func (s *Series[T]) Apply(ctx context.Context, fn ApplySeriesFn[T], options ...ApplyOptions) (*Series[T], error)
Apply applies filter function to series. If ApplyOptions are set as `ApplyOptions { InPlace: true }` then series is modified, otherwise new series is returned.
func (*Series[T]) Copy ¶
func (s *Series[T]) Copy(options ...RangeOptions) *Series[T]
Copy will create a new copy of the series. It is recommended that you lock the Series before attempting to Copy.
func (*Series[T]) CopyAny ¶
func (s *Series[T]) CopyAny(options ...RangeOptions) SeriesAny
CopyAny will create a new copy of the series. It is recommended that you lock the Series before attempting to Copy.
func (*Series[T]) FillRandAny ¶
FillRandAny will fill a Series with random data.
func (*Series[T]) Filter ¶
func (s *Series[T]) Filter(ctx context.Context, fn FilterSeriesFn[T], options ...FilterOptions) (*Series[T], error)
Filter applies filter function to series. If FilterOptions are set as `FilterOptions { InPlace: true }` then series is modified, otherwise new series is returned.
func (*Series[T]) Insert ¶
Insert is used to set a value at an arbitrary row in the series. All existing values from that row onwards are shifted by 1.
func (*Series[T]) InsertAny ¶
InsertAny is used to set a value at an arbitrary row in the series. All existing values from that row onwards are shifted by 1.
func (*Series[T]) IsEqual ¶
func (s *Series[T]) IsEqual(ctx context.Context, s2 *Series[T], options ...IsEqualOptions) (bool, error)
IsEqual returns true if s2's values are equal to s.
func (*Series[T]) IsEqualAny ¶
func (s *Series[T]) IsEqualAny(ctx context.Context, s2 SeriesAny, options ...IsEqualOptions) (bool, error)
IsEqualAny returns true if s2's values are equal to s.
func (*Series[T]) IsEqualAnyFunc ¶
IsEqualAnyFunc returns true if a is equal to b.
func (*Series[T]) IsEqualFunc ¶
IsEqualFunc returns true if a is equal to b.
func (*Series[T]) IsLessThanAnyFunc ¶
IsLessThanAnyFunc returns true if a is less than b.
func (*Series[T]) IsLessThanFunc ¶
IsLessThanFunc returns true if a is less than b.
func (*Series[T]) Iterator ¶
func (s *Series[T]) Iterator(options ...IteratorOptions) Iterator[T]
Iterator will return a iterator that can be used to iterate through all the values.
func (*Series[T]) IteratorAny ¶
func (s *Series[T]) IteratorAny(options ...IteratorOptions) Iterator[any]
IteratorAny will return a iterator that can be used to iterate through all the values.
func (*Series[T]) PrependAny ¶
PrependAny is used to set a value to the beginning of the series.
func (*Series[T]) SetIsEqualAnyFunc ¶
SetIsEqualAnyFunc sets a function which can be used to determine if 2 values in the series are equal.
func (*Series[T]) SetIsEqualFunc ¶
SetIsEqualFunc sets a function which can be used to determine if 2 values in the series are equal.
func (*Series[T]) SetIsLessThanAnyFunc ¶
SetIsLessThanAnyFunc sets a function which can be used to determine if a value is less than another in the series.
func (*Series[T]) SetIsLessThanFunc ¶
SetIsLessThanFunc sets a function which can be used to determine if a value is less than another in the series.
func (*Series[T]) SetValueToStringFormatter ¶
func (s *Series[T]) SetValueToStringFormatter(f ValueToStringFormatter)
SetValueToStringFormatter is used to set a function to convert the value of a particular row to a string representation.
func (*Series[T]) Sort ¶
func (s *Series[T]) Sort(ctx context.Context, options ...SortOptions) (completed bool)
Sort will sort the series. It will return true if sorting was completed or false when the context is canceled.
func (*Series[T]) String ¶
String implements the fmt.Stringer interface. It does not lock the Series.
func (*Series[T]) Table ¶
func (s *Series[T]) Table(options ...TableOptions) string
Table will produce the Series in a table.
type SeriesAny ¶
type SeriesAny interface { // Name returns the series name. Name(options ...Options) string // Rename renames the series. Rename(n string, options ...Options) // Type returns type of the series as string value. Type() string // NRows returns how many rows the series contains. NRows(options ...Options) int // ValueAny returns the value of a particular row. ValueAny(row int, options ...Options) any // ValueString returns a string representation of a // particular row. The string representation is defined // by the function set in SetValueToStringFormatter. // By default, a nil value is returned as "NaN". ValueString(row int, options ...Options) string // Prepend is used to set a value to the beginning of the // series. PrependAny(val any, options ...Options) // AppendAny is used to set a value to the end of the series. AppendAny(val any, options ...Options) int // InsertAny is used to set a value at an arbitrary row in // the series. All existing values from that row onwards // are shifted by 1. InsertAny(row int, val any, options ...Options) // Remove is used to delete the value of a particular row. Remove(row int, options ...Options) // Reset is used clear all data contained in the Series. Reset(options ...Options) // Update is used to update the value of a particular row. UpdateAny(row int, val any, options ...Options) // IteratorAny will return a iterator that can be used to iterate through all the values. IteratorAny(options ...IteratorOptions) Iterator[any] // SetValueToStringFormatter is used to set a function // to convert the value of a particular row to a string // representation. SetValueToStringFormatter(f ValueToStringFormatter) // Swap is used to swap 2 values based on their row position. Swap(row1, row2 int, options ...Options) // IsEqualAnyFunc returns true if a is equal to b. IsEqualAnyFunc(a, b any) bool // IsLessThanAnyFunc returns true if a is less than b. IsLessThanAnyFunc(a, b any) bool // SetIsEqualAnyFunc sets a function which can be used to determine // if 2 values in the series are equal. SetIsEqualAnyFunc(f CompareFn[any]) // SetIsLessThanAnyFunc sets a function which can be used to determine // if a value is less than another in the series. SetIsLessThanAnyFunc(f CompareFn[any]) // Sort will sort the series. // It will return true if sorting was completed or false when the context is canceled. Sort(ctx context.Context, options ...SortOptions) (completed bool) // CopyAny will create a new copy of the series. // It is recommended that you lock the Series before attempting // to Copy. CopyAny(options ...RangeOptions) SeriesAny // Table will produce the Series in a table. Table(options ...TableOptions) string // String implements the fmt.Stringer interface. It does not lock the Series. String() string // FillRandAny will fill a Series with random data. FillRandAny(rnd RandFn[any]) // IsEqualAny returns true if s2's values are equal to s. IsEqualAny(ctx context.Context, s2 SeriesAny, options ...IsEqualOptions) (bool, error) // RWMutex Lock Lock() // RWMutex Unlock Unlock() // RWMutex RLock RLock() // RWMutex RUnlock RUnlock() // contains filtered or unexported methods }
type SeriesInit ¶
type SeriesInit struct { // Prefill the series with nil ("NaN") or default value with // Size number of rows. Size int // How much memory to preallocate. // If you know the size of the series in advance, // it is better to preallocate the capacity of the // underlying slice. Capacity int }
SeriesInit is used to configure the series when it is initialized
type SortKey ¶
type SortKey struct { // Key can be an int (position of series) or string (name of series). Key any // Desc can be set to sort in descending order. Desc bool // contains filtered or unexported fields }
SortKey is the key to sort a Dataframe
type SortOptions ¶
type SortOptions struct {
Stable, Desc, DontLock bool
}
SortOptions is defined as an optional parameters for Sort(...) on top of Series or DataFrame.
Defaults:
SortOptions { Stable: false, Desc: false, DontLock: false }
Properties:
- `Desc` - if true, then values will be sorted in descending order
- `DontLock` - if set to true, then operation is performed without locking RWMutex
type TableOptions ¶
type TableOptions struct { Series []any Range RangeOptions DontLock bool }
TableOptions is defined as an optional parameters for Table(...) on top of Series or DataFrame.
Defaults:
TableOptions { Series: nil, Range: RangeOptions { Start: 0, End: nil } DontLock: false }
Properties:
- `Series` - is int or string and indicates which series should table contains. Affets only DataFrame
- `Range` - specifies range for displayed table
- `DontLock` - if set to true, then operation is performed without locking RWMutex
type ValueToStringFormatter ¶
ValueToStringFormatter is used to convert a value into a string.