A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pandas.pydata.org/docs/dev/user_guide/../reference/api/pandas.DataFrame.plot.pie.html below:

pandas.DataFrame.plot.pie — pandas 3.0.0.dev0+2231.g4f2aa4d2be documentation

pandas.DataFrame.plot.pie#
DataFrame.plot.pie(y=None, **kwargs)[source]#

Generate a pie plot.

A pie plot is a proportional representation of the numerical data in a column. This function wraps matplotlib.pyplot.pie() for the specified column. If no column reference is passed and subplots=True a pie plot is drawn for each numerical column independently.

Parameters:
yint or label, optional

Label or position of the column to plot. If not provided, subplots=True argument must be passed.

**kwargs

Keyword arguments to pass on to DataFrame.plot().

Returns:
matplotlib.axes.Axes or np.ndarray of them

A NumPy array is returned when subplots is True.

Examples

In the example below we have a DataFrame with the information about planet’s mass and radius. We pass the ‘mass’ column to the pie function to get a pie plot.

>>> df = pd.DataFrame(
...     {"mass": [0.330, 4.87, 5.97], "radius": [2439.7, 6051.8, 6378.1]},
...     index=["Mercury", "Venus", "Earth"],
... )
>>> plot = df.plot.pie(y="mass", figsize=(5, 5))
>>> plot = df.plot.pie(subplots=True, figsize=(11, 6))

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4