str.
get
Extract element from each string or string list/tuple in the Series at the specified position.
Position of element to extract.
Examples
>>> s1 = ks.Series(["String", "123"]) >>> s1 0 String 1 123 Name: 0, dtype: object
>>> s1.str.get(1) 0 t 1 2 Name: 0, dtype: object
>>> s1.str.get(-1) 0 g 1 3 Name: 0, dtype: object
>>> s2 = ks.Series([["a", "b", "c"], ["x", "y"]]) >>> s2 0 [a, b, c] 1 [x, y] Name: 0, dtype: object
>>> s2.str.get(0) 0 a 1 x Name: 0, dtype: object
>>> s2.str.get(2) 0 c 1 None Name: 0, dtype: object