Documentation ¶
Index ¶
- Constants
- Variables
- func Abs[T BaseType](x []T) []T
- func AbsFloat32(n float32) float32
- func AbsFloat64(n float64) float64
- func AbsInt(n int) int
- func AbsInt16(n int16) int16
- func AbsInt32(n int32) int32
- func AbsInt64(n int64) int64
- func AbsInt8(n int8) int8
- func Add[T Number](x []T, y any) []T
- func Align[E BaseType](x []E, a E, n int) []E
- func All[T Number | ~bool](x []T) bool
- func And[S ~[]E, E any](v S, x any) []bool
- func Any[T Number | ~bool](x []T) bool
- func AnyToBool(v any) bool
- func AnyToFloat32(v any) float32
- func AnyToFloat64(v any) float64
- func AnyToGeneric[T BaseType](v any) T
- func AnyToInt32(v any) int32
- func AnyToInt64(v any) int64
- func AnyToSlice[T BaseType](A any, N int) []T
- func AnyToString(v any) string
- func Arange[T Number](start T, end T, argv ...T) []T
- func ArgMax[T Number](x []T) int
- func ArgMax2[T BaseType](x []T) int
- func ArgMin[T Number](x []T) int
- func ArgMin2[T BaseType](x []T) int
- func BinaryOperations[T Number](x []T, y any, f32 func(x, y []float32) []float32, ...) []T
- func BinaryOperations2[T BaseType, E BaseType](x, y []T, f32 func(x, y []float32) []E, f64 func(x, y []float64) []E, ...) []E
- func BoolToFloat32(b bool) float32
- func BoolToFloat64(b bool) float64
- func BoolToInt(b bool) int8
- func BoolToInt32(b bool) int32
- func BoolToInt64(b bool) int64
- func BoolToString(b bool) string
- func ChangeRate[B Number, C Number](baseValue B, currentValue C) (changeRate float64)
- func CheckoutRawType(frame any) reflect.Kind
- func Concat1D[T Number](a, b, c []T) [][]T
- func ConfidenceIntervalToZscore(confidenceInterval float64) (zScore float64)
- func Count[T Number | ~bool](x []T) int
- func Covariance(x, y []float64) float64
- func CumSum[T Number](x []T) []T
- func DType2Int(d []DType) []int32
- func DTypeIsNaN(d DType) bool
- func Decimal(value float64, digits ...int) float64
- func DefaultFormatter(v any) string
- func DegreesToSlope(x float64) float64
- func Diff[E Number](S []E, n int) []E
- func Div[T Number](x []T, y any) []T
- func Dot[T Number](a, b [][]T) [][]T
- func Dot1D[T Number](a, b []T) T
- func Dot2D[T Number](a, b [][]T) [][]T
- func Dot2D1[T Number](a [][]T, b []T) []T
- func Dot2D1_v2[T Number](a [][]T, b []T) []T
- func Dot2D_V1[T Number](a, b [][]T) [][]T
- func Dot_v1[T Number](a, b [][]T) [][]T
- func Equal[T BaseType](x, y []T) []bool
- func ExtractValueFromPointer(v any) (any, bool)
- func Fill[T BaseType](v []T, d T, args ...any) (rows []T)
- func FillNa[T BaseType](x []T, v any, args ...any) []T
- func FindPercent(zScore float64) (percent float64)
- func FindZScore(percent float64) (zScore float64)
- func Float32IsNaN(f float32) bool
- func Float32NaN() float32
- func Float64IsNaN(f float64) bool
- func Float64NaN() float64
- func GenericParse[T BaseType](text string) T
- func GetAvx2Enabled() bool
- func Gt[S ~[]E, E any](v S, x any) []bool
- func Gte[S ~[]E, E any](v S, x any) []bool
- func Inverse(a [][]float64) [][]float64
- func IsEmpty(s string) bool
- func IsNaN(f float64) bool
- func Lt[S ~[]E, E any](v S, x any) []bool
- func Lte[S ~[]E, E any](v S, x any) []bool
- func Max[T Number](x []T) T
- func Max2[T BaseType](x []T) T
- func Maximum[T Number](f1, f2 []T) []T
- func Mean[T Number](x []T) T
- func Mean2[T BaseType](x []T) T
- func Min[T Number](x []T) T
- func Min2[T BaseType](x []T) T
- func Minimum[T Number](f1, f2 []T) []T
- func Mul[T Number](x []T, y any) []T
- func NetChangeRate[B Number, C Number](baseValue B, currentValue C) (changeRate float64)
- func Not[S ~[]E, E any](v S) []bool
- func NotEqual[T BaseType](x, y []T) []bool
- func Ones[T Number](v []T) []T
- func Or[S ~[]E, E any](v S, x any) []bool
- func PanicTrace(err interface{}) string
- func ParseBool(s string, v any) bool
- func ParseFloat32(s string, v any) float32
- func ParseFloat64(s string, v any) float64
- func ParseInt32(s string, v any) int32
- func ParseInt64(s string, v any) int64
- func PeeksAndValleys[E Number](x []E) (peeks, valleys []int)
- func Pow[T Number](v []T, n int) []T
- func PrintString(v any) string
- func Range[E Number](n int) []E
- func Repeat[E BaseType](x E, n int) []E
- func RepeatInto[E BaseType](s []E, a E, n int) []E
- func Rolling[E BaseType](S []E, N any) [][]E
- func RollingV1[E BaseType](S []E, N any, apply func(N DType, values ...E) E) []E
- func SetAvx2Enabled(enabled bool)
- func Shape[T Number](x any) (r, c int)
- func Shift[E BaseType](S []E, N any) []E
- func SliceFloatToInt32[T Float](x []T) []int32
- func SliceFloatToInt64[T Float](x []T) []int64
- func SliceToBool(v any) []bool
- func SliceToFloat32(v any) []float32
- func SliceToFloat64(v any) []float64
- func SliceToInts(v any) []int
- func SliceToString(v any) []string
- func Slope(x1 int, y1 float64, x2 int, y2 float64) float64
- func SlopeToDegrees(m float64) float64
- func Sqrt[T Number](v []T) []T
- func Std[T BaseType](x []T) T
- func StringIsFalse(s string) bool
- func StringIsNaN(s string) bool
- func StringIsTrue(s string) bool
- func Sub[T Number](x []T, y any) []T
- func SubInplace[T Number](x []T, y any) []T
- func Sum[E Number](x []E) E
- func Transpose2D[T Number](x [][]T) [][]T
- func TriangleBevel(slope float64, x1 int, y1 float64, xn int) float64
- func TypeDefault[T BaseType]() T
- func TypeError(tv any) error
- func UnaryOperations[T Number](x []T, f32 func([]float32) []float32, f64 func([]float64) []float64, ...) []T
- func UnaryOperations1[T Number](x []T, f32 func([]float32) float32, f64 func([]float64) float64, ...) T
- func UnaryOperations2[T Number, E Number](x []T, f32 func([]float32) E, f64 func([]float64) E, cany func([]T) E) E
- func V2Diff[T BaseType](s []T, param any) []Tdeprecated
- func Variance(x []float64) float64
- func Where[T StatType](condition []T, x, y []T) []T
- func Zeros[T BaseType](shape int) []T
- func ZscoreToConfidenceInterval(zScore float64) (confidenceInterval float64)
- type Array
- type BaseType
- type BigFloat
- type Complex
- type DType
- type DTypeArray
- type DataPoint
- type Float
- type GenericType
- type Integer
- type Line
- func (this Line) Analyze(data []float64, digits int) (X, Y []float64, tendency []LinerTrend)
- func (this Line) Angle(other Line) float64
- func (this Line) Degrees() float64
- func (this Line) Distance(p Point) float64
- func (this Line) Equation() (A, B, C float64)
- func (this Line) Extend(data []float64, digits int) (X, Y []float64, tendency int)
- func (this Line) HorizontalDistance(p Point) float64
- func (this Line) Incr(n int) (x, y float64)
- func (this Line) ParallelLine(p Point) Line
- func (this Line) Radian() float64
- func (this Line) ShortestDistance(other Line) float64
- func (this Line) SymmetricParallelLine(p Point) Line
- func (this Line) VerticalDistance(p Point) float64
- func (this Line) X(y float64) float64
- func (this Line) Y(x float64) float64
- type LinerTrend
- type MoveTypedeprecated
- type Number
- type Number16deprecated
- type Number32deprecated
- type Number64deprecated
- type Number8deprecated
- type NumberOfCPUBitsRelated
- type Ordered
- type Periods
- type Point
- type QuantizationFactor
- type Signed
- type StatType
- type StringFormatter
- type Unsigned
- type Windowdeprecated
Constants ¶
const ( Unchanged = 0 // 趋势不变 BreakThrough = 1 // break through 突破 FallDrastically = -1 // fall drastically 跌破 )
趋势变化
const ( TendencyUnchanged = 0 // 趋势不变 TendencyBreakThrough = 1 // break through 突破 TendencyFallDrastically = -1 // fall drastically 跌破 )
趋势变化
const ( Nil2Bool = false // 空指针转bool BoolNaN = false // bool 无效值 True2Bool = true // true转bool False2Bool = false // false 转bool True2Float32 float32 = float32(1) // true转float32 False2Float32 float32 = float32(0) // false转float32 StringBad2Bool = false // 字符串解析bool异常 StringTrue2Bool = true // 字符串true转bool StringFalse2Bool = false // 字符串false转bool )
const ( MaxFloat32 = float32(math.MaxFloat32) // float32最大值 MinFloat32 = float32(math.SmallestNonzeroFloat32) // float32最小值 StringTrue2Float32 float32 = float32(1) // 字符串true转float32 StringFalse2Float32 float32 = float32(0) // 字符串false转float32 )
const ( MaxFloat64 float64 = float64(math.MaxFloat64) // float64最大值 MinFloat64 float64 = float64(math.SmallestNonzeroFloat64) // float64最小值 True2Float64 float64 = float64(1) // true转float64 False2Float64 float64 = float64(0) // false转float64 StringNil2Float float64 = float64(0) // deprecated: 字符串空指针转float64 StringBad2Float float64 = float64(0) // deprecated: 字符串解析float64异常 StringTrue2Float64 float64 = float64(1) // 字符串true转float64 StringFalse2Float64 float64 = float64(0) // 字符串false转float64 )
const ( MaxInt32 = int32(math.MaxInt32) MinInt32 = int32(math.MinInt32) Nil2Int32 = int32(0) // 空指针转int32 Int32NaN = int32(0) // int32 无效值 True2Int32 = int32(1) // true转int32 False2Int32 = int32(0) // false 转int32 StringBad2Int32 = int32(0) // 字符串解析int32异常 StringTrue2Int32 = int32(1) // 字符串true转int32 StringFalse2Int32 = int32(0) // 字符串false转int32 )
const ( MaxInt64 = int64(math.MaxInt64) MinInt64 = int64(math.MinInt64) Nil2Int64 = int64(0) // 空指针转int64 Int64NaN = int64(0) // int64 无效值 True2Int64 = int64(1) // true转int64 False2Int64 = int64(0) // false 转int64 StringBad2Int64 = int64(0) // 字符串解析int64异常 StringTrue2Int64 = int64(1) // 字符串true转int64 StringFalse2Int64 = int64(0) // 字符串false转int64 )
const ( StringNaN = "NaN" // 字符串NaN Nil2String = "NaN" // nil指针转string True2String = "true" // true转string False2String = "false" // false转string )
Variables ¶
var ( // ErrUnsupportedType 不支持的类型 ErrUnsupportedType = errors.New("unsupported type") ErrRange = errors.New("range error") ErrInvalidWindow = errors.New("error window") )
var (
IgnoreParseExceptions = true // 忽略解析异常
)
var ( // PossibleNaOfString 有可能出现的NaN字符串的全部选项 PossibleNaOfString = []string{"NA", "NaN", "nan", "<nil>"} )
Functions ¶
func AbsFloat32 ¶ added in v0.1.0
func AbsFloat64 ¶ added in v0.1.0
func AbsInt8 ¶ added in v0.1.0
AbsInt8 gets absolute value of int8.
Example 1: AbsInt8(-5) -5 code value as below original code 1000,0101 inverse code 1111,1010 complement code 1111,1011 Negative numbers are represented by complement code in memory. shifted = n >> 7 = (1111,1011) >> 7 = 1111,1111 = -1(10-base) (负数右移,左补1)
1111,1011
n xor shifted = ----------- = 0000,0100 = 4(10-base)
1111,1111
(n ^ shifted) - shifted = 4 - (-1) = 5
Example 2: AbsInt8(5) 5 code value as below original code 0000,0101 Positive numbers are represented by original code in memory, and the XOR operation between positive numbers and 0 is equal to itself. shifted = n >> 7 = 0
0000,0101
n xor shifted = ----------- = 0000,0101 = 5(10-base)
0000,0000
(n ^ shifted) - shifted = 5 - 0 = 5
func AnyToFloat32 ¶
func AnyToFloat64 ¶
func AnyToGeneric ¶
AnyToGeneric any转其它类型, 推导T的类型 支持3个方向: any到number, any到bool, any到string
func Arange ¶
func Arange[T Number](start T, end T, argv ...T) []T
Arange Return evenly spaced values within a given interval.
返回给定间隔内的等间距值
func BinaryOperations ¶
func BinaryOperations[T Number](x []T, y any, f32 func(x, y []float32) []float32, f64 func(x, y []float64) []float64, cany func(x, y []T) []T) []T
BinaryOperations 二元运算 binary operations
Binary operation calculate
func BinaryOperations2 ¶
func BoolToInt32 ¶
func BoolToInt64 ¶
func ChangeRate ¶
ChangeRate 增长率
func Concat1D ¶
func Concat1D[T Number](a, b, c []T) [][]T
Concat1D
Translates slice objects to concatenation along the second axis. 沿第二个轴将切片对象转换为串联
func ConfidenceIntervalToZscore ¶
ConfidenceIntervalToZscore 通过置信区间百分比查找Z分值
func DefaultFormatter ¶
DefaultFormatter will return a string representation of the data in a particular row.
func Dot2D ¶
func Dot2D[T Number](a, b [][]T) [][]T
Dot2D 二维矩阵点积
点积(dot)运算及简单应用 https://www.jianshu.com/p/482abac8798c
func ExtractValueFromPointer ¶
ExtractValueFromPointer 从指针/地址提取值 Extract value from pointer
func Fill ¶
Fill 填充
Fill NA/NaN values using the specified method. Parameters ---------- value : scalar, dict, Series, or DataFrame Value to use to fill holes (e.g. 0), alternately a dict/Series/DataFrame of values specifying which value to use for each index (for a Series) or column (for a DataFrame). Values not in the dict/Series/DataFrame will not be filled. This value cannot be a list. method : {{'backfill', 'bfill', 'pad', 'ffill', None}}, default None Method to use for filling holes in reindexed Series pad / ffill: propagate last valid observation forward to next valid backfill / bfill: use next valid observation to fill gap. axis : {axes_single_arg} Axis along which to fill missing values. For `Series` this parameter is unused and defaults to 0. inplace : bool, default False [√] If True, fill in-place. Note: this will modify any other views on this object (e.g., a no-copy slice for a column in a DataFrame). limit : int, default None If method is specified, this is the maximum number of consecutive NaN values to forward/backward fill. In other words, if there is a gap with more than this number of consecutive NaNs, it will only be partially filled. If method is not specified, this is the maximum number of entries along the entire axis where NaNs will be filled. Must be greater than 0 if not None. downcast : dict, default is None A dict of item->dtype of what to downcast if possible, or the string 'infer' which will try to downcast to an appropriate equal type (e.g. float64 to int64 if possible). Returns ------- []T or None
func FindPercent ¶
func FindZScore ¶
func Float32NaN ¶ added in v0.0.6
func Float32NaN() float32
func Float64NaN ¶ added in v0.0.6
func Float64NaN() float64
Float64NaN returns an IEEE 754 “not-a-number” value.
func Inverse ¶
Inverse 计算矩阵的(乘法)逆
Compute the (multiplicative) inverse of a matrix. Given a square matrix `a`, return the matrix `ainv` satisfying ``dot(a, ainv) = dot(ainv, a) = eye(a.shape[0])``.
func Maximum ¶
func Maximum[T Number](f1, f2 []T) []T
Maximum AVX2版本, 两个序列横向比较最大值
TODO:print(np.maximum(1.4, np.nan)) 输出nan
func NetChangeRate ¶
NetChangeRate 净增长率, 去掉百分比
func ParseFloat64 ¶
ParseFloat64 字符串转float64 任意组合的nan字符串都会被解析成NaN
func PeeksAndValleys ¶ added in v0.1.4
func PrintString ¶
func Rolling ¶
Rolling returns an array with elements that roll beyond the last position are re-introduced at the first. 滑动窗口, 数据不足是用空数组占位
func SliceFloatToInt32 ¶ added in v0.1.0
SliceFloatToInt32 浮点转int32
func SliceFloatToInt64 ¶ added in v0.1.0
SliceFloatToInt64 浮点转int64
func StringIsFalse ¶
func StringIsTrue ¶
func SubInplace ¶ added in v0.1.3
SubInplace 减法 x = x - y
func TriangleBevel ¶
TriangleBevel 三角形斜边
func UnaryOperations ¶
func UnaryOperations[T Number](x []T, f32 func([]float32) []float32, f64 func([]float64) []float64, cany func([]T) []T) []T
UnaryOperations 一元运算 unary operations
func UnaryOperations1 ¶
func UnaryOperations2 ¶
func UnaryOperations2[T Number, E Number](x []T, f32 func([]float32) E, f64 func([]float64) E, cany func([]T) E) E
UnaryOperations2 一元运算 unary operations
运算和返回值是两种类型
func Where ¶
func Where[T StatType](condition []T, x, y []T) []T
Where 返回根据“条件”从“x”或“y”中选择的元素 这里先实现一个简单的, 留给于总重构 params只支持两个默认值x和y, 如果condition为true返回x, 否则返回y condition和param都可能是基础数据类型,也可能是一个slice, 并且长度可能不一致 直接写成序列版本, 可能更简单
func Zeros ¶
Zeros Return a new array of given shape and type, filled with zeros.
args[0] dtype 基础数据类型
func ZscoreToConfidenceInterval ¶
ZscoreToConfidenceInterval 通过分值查找置信区间
Types ¶
type Complex ¶
type Complex interface { ~complex64 | ~complex128 }
Complex is a constraint that permits any complex numeric type. If future releases of Go add new predeclared complex numeric types, this constraint will be modified to include them.
type DType ¶
type DType = float64
func Median ¶
Median returns median value of series. Linear interpolation is used for odd length.
中间值 TODO:未加验证,
func PolyFit ¶
PolyFit
Least squares polynomial fit. .. note:: This forms part of the old polynomial API. Since version 1.4, the new polynomial API defined in `numpy.polynomial` is preferred. A summary of the differences can be found in the :doc:`transition guide </reference/routines.polynomials>`. Fit a polynomial ``p(x) = p[0] * x**deg + ... + p[deg]`` of degree `deg` to points `(x, y)`. Returns a vector of coefficients `p` that minimises the squared error in the order `deg`, `deg-1`, ... `0`. The `Polynomial.fit <numpy.polynomial.polynomial.Polynomial.fit>` class method is recommended for new code as it is more stable numerically. See the documentation of the method for more information. Parameters ---------- x : array_like, shape (M,) x-coordinates of the M sample points ``(x[i], y[i])``. y : array_like, shape (M,) or (M, K) y-coordinates of the sample points. Several data sets of sample points sharing the same x-coordinates can be fitted at once by passing in a 2D-array that contains one dataset per column. deg : int Degree of the fitting polynomial Returns ------- p : ndarray, shape (deg + 1,) or (deg + 1, K) Polynomial coefficients, highest power first. If `y` was 2-D, the coefficients for `k`-th data set are in ``p[:,k]``. residuals, rank, singular_values, rcond These values are only returned if ``full == True`` - residuals -- sum of squared residuals of the least squares fit - rank -- the effective rank of the scaled Vandermonde coefficient matrix - singular_values -- singular values of the scaled Vandermonde coefficient matrix - rcond -- value of `rcond`. For more details, see `numpy.linalg.lstsq`. Warns ----- RankWarning The rank of the coefficient matrix in the least-squares fit is deficient. The warning is only raised if ``full == False``. The warnings can be turned off by >>> import warnings >>> warnings.simplefilter('ignore', np.RankWarning) See Also -------- polyval : Compute polynomial values. linalg.lstsq : Computes a least-squares fit. scipy.interpolate.UnivariateSpline : Computes spline fits. Notes ----- The solution minimizes the squared error .. math:: E = \\sum_{j=0}^k |p(x_j) - y_j|^2 in the equations:: x[0]**n * p[0] + ... + x[0] * p[n-1] + p[n] = y[0] x[1]**n * p[0] + ... + x[1] * p[n-1] + p[n] = y[1] ... x[k]**n * p[0] + ... + x[k] * p[n-1] + p[n] = y[k] The coefficient matrix of the coefficients `p` is a Vandermonde matrix. `polyfit` issues a `RankWarning` when the least-squares fit is badly conditioned. This implies that the best fit is not well-defined due to numerical error. The results may be improved by lowering the polynomial degree or by replacing `x` by `x` - `x`.mean(). The `rcond` parameter can also be set to a value smaller than its default, but the resulting fit may be spurious: including contributions from the small singular values can add numerical noise to the result. Note that fitting polynomial coefficients is inherently badly conditioned when the degree of the polynomial is large or the interval of sample points is badly centered. The quality of the fit should always be checked in these cases. When polynomial fits are not satisfactory, splines may be a good alternative. References ---------- .. [1] Wikipedia, "Curve fitting", https://en.wikipedia.org/wiki/Curve_fitting .. [2] Wikipedia, "Polynomial interpolation", https://en.wikipedia.org/wiki/Polynomial_interpolation .. [3] numpy.polyfit(x, y, deg, rcond=None, full=False, w=None, cov=False) https://numpy.org/doc/stable/reference/generated/numpy.polyfit.html Examples -------- >>> import warnings >>> x = np.array([0.0, 1.0, 2.0, 3.0, 4.0, 5.0]) >>> y = np.array([0.0, 0.8, 0.9, 0.1, -0.8, -1.0]) >>> z = np.polyfit(x, y, 3) >>> z array([ 0.08703704, -0.81349206, 1.69312169, -0.03968254]) # may vary
func PolyVal ¶
PolyVal
Evaluate a polynomial at specific values. .. note:: This forms part of the old polynomial API. Since version 1.4, the new polynomial API defined in `numpy.polynomial` is preferred. A summary of the differences can be found in the :doc:`transition guide </reference/routines.polynomials>`. If `p` is of length N, this function returns the value: ``p[0]*x**(N-1) + p[1]*x**(N-2) + ... + p[N-2]*x + p[N-1]`` If `x` is a sequence, then ``p(x)`` is returned for each element of ``x``. If `x` is another polynomial then the composite polynomial ``p(x(t))`` is returned. Parameters
----------
p : array_like or poly1d object 1D array of polynomial coefficients (including coefficients equal to zero) from highest degree to the constant term, or an instance of poly1d. x : array_like or poly1d object A number, an array of numbers, or an instance of poly1d, at which to evaluate `p`. Returns
-------
values : ndarray or poly1d If `x` is a poly1d instance, the result is the composition of the two polynomials, i.e., `x` is "substituted" in `p` and the simplified result is returned. In addition, the type of `x` - array_like or poly1d - governs the type of the output: `x` array_like => `values` array_like, `x` a poly1d object => `values` is also. See Also -------- poly1d: A polynomial class. Notes ----- Horner's scheme [1]_ is used to evaluate the polynomial. Even so, for polynomials of high degree the values may be inaccurate due to rounding errors. Use carefully. If `x` is a subtype of `ndarray` the return value will be of the same type. References ---------- .. [1] I. N. Bronshtein, K. A. Semendyayev, and K. A. Hirsch (Eng. trans. Ed.), *Handbook of Mathematics*, New York, Van Nostrand Reinhold Co., 1985, pg. 720. Examples -------- >>> np.polyval([3,0,1], 5) # 3 * 5**2 + 0 * 5**1 + 1 76 >>> np.polyval([3,0,1], np.poly1d(5)) poly1d([76]) >>> np.polyval(np.poly1d([3,0,1]), 5) 76 >>> np.polyval(np.poly1d([3,0,1]), np.poly1d(5)) poly1d([76])
type DTypeArray ¶ added in v0.0.7
type DTypeArray interface {
DTypes() []DType // to dtype
}
DTypeArray 获取DType切片的接口
type Float ¶
Float is a constraint that permits any floating-point type. If future releases of Go add new predeclared floating-point types, this constraint will be modified to include them.
type GenericType ¶
GenericType Series支持的所有类型 Deprecated: 不推荐使用
type Integer ¶
Integer is a constraint that permits any integer type. If future releases of Go add new predeclared integer types, this constraint will be modified to include them.
type Line ¶ added in v0.1.4
type Line struct {
// contains filtered or unexported fields
}
Line LineEquation 线性方程式
① Ax + By + C = 0 ② 斜率k = -(A/B) ③ x截距 = -(C/A), y截距 = -(C/B)
func CalculateLineEquation ¶ added in v0.1.4
CalculateLineEquation 已知两个点, 计算线性方程式
func (Line) Analyze ¶ added in v0.2.6
func (this Line) Analyze(data []float64, digits int) (X, Y []float64, tendency []LinerTrend)
Analyze 分析线性趋势
func (Line) Distance ¶ added in v0.1.4
Distance 点到线的距离
___________ 公式 |(Ax0 + By0 + C)| / √(A^2 + B^2)
func (Line) ParallelLine ¶ added in v0.1.4
ParallelLine 通过 一个点的y轴坐标计算一个新的平行线
func (Line) ShortestDistance ¶ added in v0.1.8
ShortestDistance 计算 与另外一条直线的最短距离
func (Line) SymmetricParallelLine ¶ added in v0.1.4
SymmetricParallelLine 计算 点对称(等距离)的平行线
type LinerTrend ¶ added in v0.1.9
LinerTrend 线性趋势
type NumberOfCPUBitsRelated ¶
NumberOfCPUBitsRelated The number of CPU bits is related Deprecated: 不推荐使用
type Ordered ¶
Ordered is a constraint that permits any ordered type: any type that supports the operators < <= >= >. If future releases of Go add new ordered types, this constraint will be modified to include them.
type Periods ¶ added in v0.1.6
Periods 周期
type QuantizationFactor ¶ added in v0.1.4
type QuantizationFactor interface {
// Normalize 归一化, 标准化, 数据预处理
Normalize()
}
QuantizationFactor 量化因子接口
type Signed ¶
Signed is a constraint that permits any signed integer type. If future releases of Go add new predeclared signed integer types, this constraint will be modified to include them.
type StringFormatter ¶
StringFormatter is used to convert a value into a string. Val can be nil or the concrete type stored by the series.
type Unsigned ¶
Unsigned is a constraint that permits any unsigned integer type. If future releases of Go add new predeclared unsigned integer types, this constraint will be modified to include them.
Source Files ¶
- abs.go
- align.go
- argmax.go
- argmin.go
- arithmetics.go
- arithmetics_add.go
- arithmetics_div.go
- arithmetics_mul.go
- arithmetics_sub.go
- builtin.go
- count.go
- covariance.go
- cross.go
- cumsum.go
- decimals.go
- diff.go
- dot.go
- errors.go
- fillna.go
- logic.go
- logic_all.go
- logic_any.go
- logic_equal.go
- matrix.go
- max.go
- maximum.go
- mean.go
- median.go
- min.go
- minimum.go
- ndarray.go
- ones.go
- periods.go
- polynomial.go
- pow.go
- range.go
- repeat.go
- rolling.go
- shape.go
- shift.go
- slope.go
- sqrt.go
- stddev.go
- sum.go
- type.go
- type_bool.go
- type_dtype.go
- type_float32.go
- type_float64.go
- type_generic.go
- type_int32.go
- type_int64.go
- type_integer.go
- type_strings.go
- vectors.go
- wave.go
- where.go
- window.go
- zeros.go
- ztable.go
- ztable_data.go
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
constraints
Package constraints defines a set of useful constraints to be used with type parameters.
|
Package constraints defines a set of useful constraints to be used with type parameters. |
rand
Package rand implements pseudo-random number generators.
|
Package rand implements pseudo-random number generators. |
Package math32 provides basic constants and mathematical functions for float32 types.
|
Package math32 provides basic constants and mathematical functions for float32 types. |