datatable.FExpr.__getitem__()¶
Apply a slice to the string column represented by this FExpr.
Parameters¶
self
FExpr[str]selector
sliceThe 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:]}]
| start | end | ||
|---|---|---|---|
| str32 | str32 | ||
| 0 | Winte | r | |
| 1 | Summ | er | |
| 2 | Aut | umn | |
| 3 | Sp | ring |
See Also¶
dt.str.slice()– the equivalent function indt.strmodule.
The content on this page is licensed under the Creative Commons Attribution 4.0 License
(CC BY 4.0) ,
and code samples are licensed under the MIT License.