datatable.FExpr.__getitem__()

Apply a slice to the string column represented by this FExpr.

Parameters

self
FExpr[str]
selector
slice

The slice will be applied to each value in the string column self.

return
FExpr[str]

Examples

DT = dt.Frame(season=["Winter", "Summer", "Autumn", "Spring"], i=[1, 2, 3, 4]) DT[:, {"start": f.season[:-f.i], "end": f.season[-f.i:]}]
startend
str32str32
0Winter
1Summer
2Autumn
3Spring

See Also