set_flags(self: 'NDFrameT', *, copy: 'bool_t' = False, allows_duplicate_labels: 'bool_t | None' = None) -> 'NDFrameT'
This method returns a new object that's a view on the same data as the input. Mutating the input or the output values will be reflected in the other.
This method is intended to be used in method chains.
"Flags" differ from "metadata". Flags reflect properties of the pandas object (the Series or DataFrame). Metadata refer to properties of the dataset, and should be stored in DataFrame.attrs
.
Whether the returned object allows duplicate labels.
The same type as the caller.
Return a new object with updated flags.
DataFrame.attrs
Global metadata applying to this dataset.
DataFrame.flags
Global flags applying to this object.
>>> df = pd.DataFrame({"A": [1, 2]})This example is valid syntax, but we were not able to check execution
... df.flags.allows_duplicate_labels True
>>> df2 = df.set_flags(allows_duplicate_labels=False)See :
... df2.flags.allows_duplicate_labels False
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