modin.pandas.Series.str.get

Series.str.get(i)[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.26.0/snowpark-python/.tox/docs/lib/python3.9/site-packages/modin/pandas/series_utils.py#L269-L270)

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
Language: English