pandas 1.4.2

ParametersReturns
get(self, i)

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

Parameters

i : int

Position of element to extract.

Returns

Series or Index

Extract element from each component at specified position.

Examples

This example is valid syntax, but we were not able to check execution
>>> s = pd.Series(["String",
...  (1, 2, 3),
...  ["a", "b", "c"],
...  123,
...  -456,
...  {1: "Hello", "2": "World"}])
... s 0 String 1 (1, 2, 3) 2 [a, b, c] 3 123 4 -456 5 {1: 'Hello', '2': 'World'} dtype: object
This example is valid syntax, but we were not able to check execution
>>> s.str.get(1)
0        t
1        2
2        b
3      NaN
4      NaN
5    Hello
dtype: object
This example is valid syntax, but we were not able to check execution
>>> s.str.get(-1)
0      g
1      3
2      c
3    NaN
4    NaN
5    None
dtype: object
See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/core/strings/accessor.py#969
type: <class 'function'>
Commit: