pandas 1.4.2

NotesParametersRaisesReturnsBackRef
select_dtypes(self, include=None, exclude=None) -> 'DataFrame'

Notes

Parameters

include, exclude : scalar or list-like

A selection of dtypes or strings to be included/excluded. At least one of these parameters must be supplied.

Raises

ValueError
  • If both of include and exclude are empty

  • If include and exclude have overlapping elements

  • If any kind of string dtype is passed in.

Returns

DataFrame

The subset of the frame including the dtypes in include and excluding the dtypes in exclude .

Return a subset of the DataFrame's columns based on the column dtypes.

See Also

DataFrame.dtypes

Return Series with the data type of each column.

Examples

This example is valid syntax, but we were not able to check execution
>>> df = pd.DataFrame({'a': [1, 2] * 3,
...  'b': [True, False] * 3,
...  'c': [1.0, 2.0] * 3})
... df a b c 0 1 True 1.0 1 2 False 2.0 2 1 True 1.0 3 2 False 2.0 4 1 True 1.0 5 2 False 2.0
This example is valid syntax, but we were not able to check execution
>>> df.select_dtypes(include='bool')
   b
0  True
1  False
2  True
3  False
4  True
5  False
This example is valid syntax, but we were not able to check execution
>>> df.select_dtypes(include=['float64'])
   c
0  1.0
1  2.0
2  1.0
3  2.0
4  1.0
5  2.0
This example is valid syntax, but we were not able to check execution
>>> df.select_dtypes(exclude=['int64'])
       b    c
0   True  1.0
1  False  2.0
2   True  1.0
3  False  2.0
4   True  1.0
5  False  2.0
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

pandas.core.generic.NDFrame.describe pandas.core.groupby.generic.SeriesGroupBy.describe pandas.core.groupby.groupby.GroupBy.describe

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/frame.py#4242
type: <class 'function'>
Commit: