Skip to content

DataFrameStat

Defined in: data-frame-stat.ts:17

Statistical and approximate-query operations on a DataFrame.

Obtained via DataFrame.stat. Mirrors DataFrameStatFunctions in the JVM Spark API.

const c = await df.stat.corr("height", "weight");
const quantiles = await df.stat.approxQuantile("latency", [0.5, 0.95, 0.99], 0.01);

Spark source: DataFrameStatFunctions.scala

approxQuantile(
cols,
probabilities,
relativeError): DataFrame;

Defined in: data-frame-stat.ts:67

Compute approximate quantiles for numerical columns.

Parameter Type
cols string[]
probabilities number[]
relativeError number

DataFrame


corr(
col1,
col2,
method?): DataFrame;

Defined in: data-frame-stat.ts:26

Compute Pearson correlation between two columns.

Parameter Type Default value
col1 string undefined
col2 string undefined
method string "pearson"

DataFrame


cov(col1, col2): DataFrame;

Defined in: data-frame-stat.ts:37

Compute sample covariance between two columns.

Parameter Type
col1 string
col2 string

DataFrame


crosstab(col1, col2): DataFrame;

Defined in: data-frame-stat.ts:47

Compute a pair-wise frequency table (contingency table).

Parameter Type
col1 string
col2 string

DataFrame


freqItems(cols, support?): DataFrame;

Defined in: data-frame-stat.ts:57

Find frequent items in the given columns.

Parameter Type
cols string[]
support? number

DataFrame