xseries

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package xseries contains specialized and/or "exotic" Series types that don't belong in the core package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultValueFormatter

func DefaultValueFormatter(v interface{}) string

DefaultValueFormatter will return a string representation of the data in a particular row.

Types

type SeriesComplex128

type SeriesComplex128 struct {

	// Values is exported to better improve interoperability with the gonum package.
	// See: https://godoc.org/gonum.org/v1/gonum
	Values []complex128
	// contains filtered or unexported fields
}

SeriesComplex128 is used for series containing complex128 data.

func NewSeriesComplex128

func NewSeriesComplex128(name string, init *dataframe.SeriesInit, vals ...interface{}) *SeriesComplex128

NewSeriesComplex128 creates a new series with the underlying type as complex128.

func (*SeriesComplex128) Append

func (s *SeriesComplex128) Append(val interface{}, opts ...dataframe.Options) int

Append is used to set a value to the end of the series. val can be a concrete data type or nil. Nil represents the absence of a value.

func (*SeriesComplex128) ContainsNil

func (s *SeriesComplex128) ContainsNil(opts ...dataframe.Options) bool

ContainsNil will return whether or not the series contains any nil values.

func (*SeriesComplex128) Copy

Copy will create a new copy of the series. It is recommended that you lock the Series before attempting to Copy.

func (*SeriesComplex128) FillRand

func (s *SeriesComplex128) FillRand(src rand.Source, probNil float64, rander dataframe.Rander, opts ...dataframe.FillRandOptions)

FillRand will fill a Series with random data. probNil is a value between between 0 and 1 which determines if a row is given a nil value.

func (*SeriesComplex128) Insert

func (s *SeriesComplex128) Insert(row int, val interface{}, opts ...dataframe.Options)

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. val can be a concrete data type or nil. Nil represents the absence of a value.

func (*SeriesComplex128) IsEqual

IsEqual returns true if s2's values are equal to s.

func (*SeriesComplex128) IsEqualFunc

func (s *SeriesComplex128) IsEqualFunc(a, b interface{}) bool

IsEqualFunc returns true if a is equal to b.

func (*SeriesComplex128) IsLessThanFunc

func (s *SeriesComplex128) IsLessThanFunc(a, b interface{}) bool

IsLessThanFunc returns true if a is less than b.

func (*SeriesComplex128) Lock

func (s *SeriesComplex128) Lock()

Lock will lock the Series allowing you to directly manipulate the underlying slice with confidence.

func (*SeriesComplex128) NRows

func (s *SeriesComplex128) NRows(opts ...dataframe.Options) int

NRows returns how many rows the series contains.

func (*SeriesComplex128) Name

func (s *SeriesComplex128) Name(opts ...dataframe.Options) string

Name returns the series name.

func (*SeriesComplex128) NewSeries

func (s *SeriesComplex128) NewSeries(name string, init *dataframe.SeriesInit) dataframe.Series

NewSeries creates a new initialized SeriesComplex128.

func (*SeriesComplex128) NilCount

func (s *SeriesComplex128) NilCount(opts ...dataframe.NilCountOptions) (int, error)

NilCount will return how many nil values are in the series.

func (*SeriesComplex128) Prepend

func (s *SeriesComplex128) Prepend(val interface{}, opts ...dataframe.Options)

Prepend is used to set a value to the beginning of the series. val can be a concrete data type or nil. Nil represents the absence of a value.

func (*SeriesComplex128) Remove

func (s *SeriesComplex128) Remove(row int, opts ...dataframe.Options)

Remove is used to delete the value of a particular row.

func (*SeriesComplex128) Rename

func (s *SeriesComplex128) Rename(n string, opts ...dataframe.Options)

Rename renames the series.

func (*SeriesComplex128) Reset

func (s *SeriesComplex128) Reset(opts ...dataframe.Options)

Reset is used clear all data contained in the Series.

func (*SeriesComplex128) SetValueToStringFormatter

func (s *SeriesComplex128) SetValueToStringFormatter(f dataframe.ValueToStringFormatter)

SetValueToStringFormatter is used to set a function to convert the value of a particular row to a string representation.

func (*SeriesComplex128) Sort

func (s *SeriesComplex128) Sort(ctx context.Context, opts ...dataframe.SortOptions) (completed bool)

Sort will sort the series. It will return true if sorting was completed or false when the context is canceled.

func (*SeriesComplex128) String

func (s *SeriesComplex128) String() string

String implements the fmt.Stringer interface. It does not lock the Series.

func (*SeriesComplex128) Swap

func (s *SeriesComplex128) Swap(row1, row2 int, opts ...dataframe.Options)

Swap is used to swap 2 values based on their row position.

func (*SeriesComplex128) Table

func (s *SeriesComplex128) Table(opts ...dataframe.TableOptions) string

Table will produce the Series in a table.

func (*SeriesComplex128) ToSeriesFloat64

func (s *SeriesComplex128) ToSeriesFloat64(ctx context.Context, removeNil bool, conv ...func(interface{}) (float64, error)) (*dataframe.SeriesFloat64, error)

ToSeriesFloat64 will convert the Series to a SeriesFloat64. The operation does not lock the Series.

func (*SeriesComplex128) ToSeriesMixed

func (s *SeriesComplex128) ToSeriesMixed(ctx context.Context, removeNil bool, conv ...func(interface{}) (*string, error)) (*dataframe.SeriesMixed, error)

ToSeriesMixed will convert the Series to a SeriesString. The operation does not lock the Series.

func (*SeriesComplex128) ToSeriesString

func (s *SeriesComplex128) ToSeriesString(ctx context.Context, removeNil bool, conv ...func(interface{}) (*string, error)) (*dataframe.SeriesString, error)

ToSeriesString will convert the Series to a SeriesString. The operation does not lock the Series.

func (*SeriesComplex128) Type

func (s *SeriesComplex128) Type() string

Type returns the type of data the series holds.

func (*SeriesComplex128) Unlock

func (s *SeriesComplex128) Unlock()

Unlock will unlock the Series that was previously locked.

func (*SeriesComplex128) Update

func (s *SeriesComplex128) Update(row int, val interface{}, opts ...dataframe.Options)

Update is used to update the value of a particular row. val can be a concrete data type or nil. Nil represents the absence of a value.

func (*SeriesComplex128) Value

func (s *SeriesComplex128) Value(row int, opts ...dataframe.Options) interface{}

Value returns the value of a particular row. The return value could be nil or the concrete type the data type held by the series. Pointers are never returned.

func (*SeriesComplex128) ValueString

func (s *SeriesComplex128) ValueString(row int, opts ...dataframe.Options) string

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".

func (*SeriesComplex128) ValuesIterator

func (s *SeriesComplex128) ValuesIterator(opts ...dataframe.ValuesOptions) func() (*int, interface{}, int)

ValuesIterator will return a function that can be used to iterate through all the values.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL