You are viewing documentation about an older version (1.20.0). View latest version

modin.pandas.Series.str.get

Series.str.get(i)

Extract element from each component at specified position or with specified key.

Extract element from lists, tuples, dict, or strings in each element in the Series/Index.

Parameters:

i (int) – Position or key of element to extract.

Return type:

Series or Index

Examples

>>> s = pd.Series(["String",
...            (1, 2, 3),
...            ["a", "b", "c"],
...            123,
...            -456,
...            {1: "Hello", "2": "World"}])
>>> s.str.get(1)
0       t
1    None
2    None
3    None
4    None
5    None
dtype: object
Copy
>>> s.str.get(-1)
0       g
1    None
2    None
3    None
4    None
5    None
dtype: object
Copy