krangl / krangl / ExpressionContext

ExpressionContext

class ExpressionContext : TableContext

A proxy on the df that exposes just parts of the DataFrame api that are relevant for table expressions

Parameters

df - A krangl.DataFrame instance

Constructors

<init>

A proxy on the df that exposes just parts of the DataFrame api that are relevant for table expressions

ExpressionContext(df: DataFrame)

Properties

nrow

val nrow: Int

Functions

where

A numpy equivalent to df['color'] = np.where(df['Set']=='Z', 'green', 'red') See https://stackoverflow.com/questions/19913659/pandas-conditional-creation-of-a-series-dataframe-column

fun where(booleans: BooleanArray, ifTrue: Any, ifFalse: Any): DataCol

Extension Functions

const

fun ExpressionContext.const(someThing: Any): DataCol

isNA

fun ExpressionContext.isNA(columnName: String): BooleanArray

isNotNA

fun ExpressionContext.isNotNA(columnName: String): BooleanArray