pandas 1.4.2

ParametersReturns
get(self, key, default=None)

Returns default value if not found.

Parameters

key : object

Returns

value : same type as items contained in object

Get item from object for given key (ex: DataFrame column).

Examples

This example is valid syntax, but we were not able to check execution
>>> df = pd.DataFrame(
...  [
...  [24.3, 75.7, "high"],
...  [31, 87.8, "high"],
...  [22, 71.6, "medium"],
...  [35, 95, "medium"],
...  ],
...  columns=["temp_celsius", "temp_fahrenheit", "windspeed"],
...  index=pd.date_range(start="2014-02-12", end="2014-02-15", freq="D"),
... )
This example is valid syntax, but we were not able to check execution
>>> df
            temp_celsius  temp_fahrenheit windspeed
2014-02-12          24.3             75.7      high
2014-02-13          31.0             87.8      high
2014-02-14          22.0             71.6    medium
2014-02-15          35.0             95.0    medium
This example is valid syntax, but we were not able to check execution
>>> df.get(["temp_celsius", "windspeed"])
            temp_celsius windspeed
2014-02-12          24.3      high
2014-02-13          31.0      high
2014-02-14          22.0    medium
2014-02-15          35.0    medium

If the key isn't found, the default value will be used.

This example is valid syntax, but we were not able to check execution
>>> df.get(["temp_celsius", "temp_kelvin"], default="default_value")
'default_value'
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/generic.py#4068
type: <class 'function'>
Commit: