Return a new grid with an additional column. The cells of the column are created by calling the mapping function for each row. The meta may be any value accepted by Etc.makeDict
Return a new grid with additional column meta-data. The new
tags are merged according to Etc.dictMerge.
The col
parameter may be either a Col or column name.
The meta may be any value accepted by Etc.makeDict.
If column is not found then return this. Also see setColMeta.
Return a new grid by adding the given grid as a new set of columns to this grid. If the given grid contains duplicate column names, then they are given auto-generated unique names. If the given grid contains fewer rows then this grid, then the missing cells are filled with null.
Return a new grid with additional grid level meta-data. The new tags are merged according to Etc.dictMerge. The meta may be any value accepted by Etc.makeDict Also see setMeta.
Return true if the function returns true for all of the rows in the grid. If the grid is empty, return false.
Return true if the function returns true for any of the rows in the grid. If the grid is empty, return false.
Cofactor
Get a column by its name. If not resolved then return null or throw UnknownNameErr based on checked flag.
Optional
checked: booleanReturn a new Grid wich each col name mapped to its localized tag name if the col does not already have a display string. See Etc.tagToLocale and docSkySpark::Localization#tags.
Return a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object:
this < that => <0
this == that => 0
this > that => >0
This method may also be accessed via the <
<=
<=>
>=
and >
shortcut operators. If not overridden the default
implementation compares the toStr
representations. Also see docLang.
Examples:
3.compare(8) => -1
8.compare(3) => 1
8.compare(8) => 0
3 <=> 8 => -1 // shortcut for 3.compare(8)
Determinant
Compare this object to the specified for equality. This
method may be accessed via the == and != shortcut operators.
If not overridden the default implementation compares for
reference equality using the === operator. If this method
is overridden, then hash() must also be overridden such that
any two objects which return true for equals() must return
the same value for hash(). This method must accept null
and
return false.
Return a new grid which finds matching rows based on the given filter. Also see findAll.
Optional
cx: HaystackContextGet the first row or return null if grid is empty.
Get floating point value for given cell in matrix
Get a row by its index number. Throw UnsupportedErr is the grid doesn't support indexed based row access.
Get a row by its index number or if index is out of bounds then return null. Throw UnsupportedErr is the grid doesn't support indexed based row access.
Return if this grid contains the given column name.
Return a unique hashcode for this object. If a class overrides hash() then it must ensure if equals() returns true for any two objects then they have same hash code.
Insert column at leftmost position and fill with given value.
Inverse
Convenience for size equal to zero.
Return if this is an error grid - meta has "err" tag.
Return if this grid conforms to the history grid shape:
This method does not check timezones or the ts cells.
Is this a square matrix where numRows == numCols
Join two grids by column name. The joinCol
parameter may be
a Col or col name. Current implementation requires:
Get the last row or return null if grid is empty. Throw UnsupportedErr is the grid doesn't support indexed based row access.
Meta-data for entire grid
Subtract two matrices together (must be of same dimension)
Return if this grid does not contains the given column name.
Number of cols in matrix
Number of rows in matrix
Return new grid with column meta-data replaced by given
meta. The col
parameter may be either a Col or column
name. The meta may be any value accepted by Etc.makeDict
If column is not found then return this. Also see addColMeta.
Return a new grid with grid level meta-data replaced by given meta. The meta may be any value accepted by Etc.makeDict. Also see addMeta.
Get the number of rows in the grid. Throw UnsupportedErr if the grid doesn't support a size.
Sort using Etc.compareDis and Dict.dis.
Get an immutable representation of this instance or throw NotImmutableErr if this object cannot be represented as an immutable:
Return a string representation of this object.
Transpose
Trap a dynamic call for handling. Dynamic calls are invoked with the -> shortcut operator:
a->x a.trap("x", null)
a->x() a.trap("x", null)
a->x = b a.trap("x", [b])
a->x(b) a.trap("x", [b])
a->x(b, c) a.trap("x", [b, c])
The default implementation provided by Obj attempts to use reflection. If name maps to a method, it is invoked with the specified arguments. If name maps to a field and args.size is zero, get the field. If name maps to a field and args.size is one, set the field and return args[0]. Otherwise throw UnknownSlotErr.
This method called whenever an it-block is applied to an
object. The default implementation calls the function with this
,
and then returns this
.
Static
arrayStatic
echoWrite x.toStr
to standard output followed by newline. If x
is null then print "null". If no argument is provided then
print an empty line.
Optional
x: JsObjStatic
fitPerform multiple linear regression using the 2 provided matrices. Y is expected to only have one column and it contains the dependent values. X will have as many columns as there are correlating factors. Y and X must have the same number of rows. X cannot have more columns that it has rows.
Static
indexStatic
makeConstruct from a grid of Numbers. Columns are named "v0", "v1", etc. We maintain grid meta, but not column meta.
MatrixGrid models a two dimensional grid of unitless Numbers. It wraps a Fantom
math::Matrix
instance.