Examples

In [1]:
import numpy as np
import pandas as pd
In [2]:
s = pd.Series(["tiger", "cat", "elephant"])
s
Out[2]:
0       tiger
1         cat
2    elephant
dtype: object
In [3]:
s.str.slice(start=1)
Out[3]:
0       iger
1         at
2    lephant
dtype: object
In [4]:
s.str.slice(stop=2)
Out[4]:
0    ti
1    ca
2    el
dtype: object

s.str.slice(step=2)

In [5]:
s.str.slice(start=0, stop=5, step=3)
Out[5]:
0    te
1     c
2    ep
dtype: object

Equivalent behaviour to:

In [6]:
s.str[0:5:3]
Out[6]:
0    te
1     c
2    ep
dtype: object