to_frame(self, index: 'bool' = True, name: 'Hashable' = <no_default>) -> 'DataFrame'
Set the index of the returned DataFrame as the original Index.
The passed name should substitute for the index name (if it has one).
DataFrame containing the original Index data.
Create a DataFrame with a column containing the Index.
Index.to_series
Convert an Index to a Series.
Series.to_frame
Convert Series to DataFrame.
>>> idx = pd.Index(['Ant', 'Bear', 'Cow'], name='animal')
... idx.to_frame() animal animal Ant Ant Bear Bear Cow Cow
By default, the original Index is reused. To enforce a new Index:
This example is valid syntax, but we were not able to check execution>>> idx.to_frame(index=False) animal 0 Ant 1 Bear 2 Cow
To override the name of the resulting column, specify :None:None:`name`
:
>>> idx.to_frame(index=False, name='zoo') zoo 0 Ant 1 Bear 2 CowSee :
The following pages refer to to this document either explicitly or contain code examples using this.
pandas.core.indexes.base.Index.to_series
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