Column¶

Classes

Column(expr1[, expr2])

Represents a column or an expression in a DataFrame.

CaseExpr(expr)

Represents a CASE expression.

Methods

Column.alias(alias)

Returns a new renamed Column.

Column.as_(alias)

Returns a new renamed Column.

Column.asc()

Returns a Column expression with values sorted in ascending order.

Column.asc_nulls_first()

Returns a Column expression with values sorted in ascending order (null values sorted before non-null values).

Column.asc_nulls_last()

Returns a Column expression with values sorted in ascending order (null values sorted after non-null values).

Column.astype(to)

Casts the value of the Column to the specified data type.

Column.between(lower_bound, upper_bound)

Between lower bound and upper bound.

Column.bitand(other)

Bitwise and.

Column.bitor(other)

Bitwise or.

Column.bitwiseAnd(other)

Bitwise and.

Column.bitwiseOR(other)

Bitwise or.

Column.bitwiseXOR(other)

Bitwise xor.

Column.bitxor(other)

Bitwise xor.

Column.cast(to)

Casts the value of the Column to the specified data type.

Column.collate(collation_spec)

Returns a copy of the original Column with the specified collation_spec property, rather than the original collation specification property.

Column.desc()

Returns a Column expression with values sorted in descending order.

Column.desc_nulls_first()

Returns a Column expression with values sorted in descending order (null values sorted before non-null values).

Column.desc_nulls_last()

Returns a Column expression with values sorted in descending order (null values sorted after non-null values).

Column.endswith(other)

Returns true if this Column ends with another string.

Column.eqNullSafe(other)

Equal to.

Column.equal_nan()

Is NaN.

Column.equal_null(other)

Equal to.

Column.getItem(field)

Accesses an element of ARRAY column by ordinal position, or an element of OBJECT column by key.

Column.getName()

Returns the column name (if the column has a name).

Column.get_name()

Returns the column name (if the column has a name).

Column.in_(*vals)

Returns a conditional expression that you can pass to the DataFrame.filter() or where DataFrame.where() to perform the equivalent of a WHERE .

Column.isNotNull()

Is not null.

Column.isNull()

Is null.

Column.is_not_null()

Is not null.

Column.is_null()

Is null.

Column.isin(*vals)

Returns a conditional expression that you can pass to the DataFrame.filter() or where DataFrame.where() to perform the equivalent of a WHERE .

Column.like(pattern)

Allows case-sensitive matching of strings based on comparison with a pattern.

Column.name(alias)

Returns a new renamed Column.

Column.over([window])

Returns a window frame, based on the specified WindowSpec.

Column.regexp(pattern[, parameters])

Returns true if this Column matches the specified regular expression.

Column.rlike(pattern[, parameters])

Returns true if this Column matches the specified regular expression.

Column.startswith(other)

Returns true if this Column starts with another string.

Column.substr(start_pos, length)

Returns a substring of this string column.

Column.substring(start_pos, length)

Returns a substring of this string column.

Column.try_cast(to)

Tries to cast the value of the Column to the specified data type.

Column.within_group(*cols)

Returns a Column expression that adds a WITHIN GROUP clause to sort the rows by the specified columns.

CaseExpr.when(condition, value)

Appends one more WHEN condition to the CASE expression.

CaseExpr.otherwise(value)

Sets the default result for this CASE expression.