isSuffix function

The isSuffix function checks whether a string is a suffix or not, and returns True in the rows of the column ending with the string value; otherwise False is returned.


Parameters

isSuffix(column, value, binary)

If you are using continuous attributes, check the Flow Execution Parameters.

Parameter

Description

column

The nominal attribute in which the value will be checked. If it is not nominal, it will be casted to nominal upon function’s computation. The column parameter is mandatory.

value

The value to be checked in the column. If it is not nominal, it will be casted to nominal upon function’s computation. The value parameter is mandatory.

The value parameter is case sensitive.

binary

If it is True, or not specified, results will be provided as Booleans (True/False), while if it is False, results will be provided in binary form (1/0).


Example

The following example uses the Adult dataset.

Description

Screenshot

In this example, we want to know if the string ‘gov’ is a suffix for all the values of the occupation attribute.

Add a new attribute, which we have called suffix, and type the following formula:

isSuffix($"workclass",'gov',False)

As we have specified the binary parameter as False, the results will be provided in binary form (1/0), where 1 means True, and 0 False.