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.html below:

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

pandas.DataFrame.plot#
DataFrame.plot(*args, **kwargs)[source]#

Make plots of Series or DataFrame.

Uses the backend specified by the option plotting.backend. By default, matplotlib is used.

Parameters:
dataSeries or DataFrame

The object for which the method is called.

Attributes

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

If the backend is not the default matplotlib one, the return value will be the object returned by the backend.

Notes

Examples

For Series:

>>> ser = pd.Series([1, 2, 3, 3])
>>> plot = ser.plot(kind="hist", title="My plot")

For DataFrame:

>>> df = pd.DataFrame(
...     {
...         "length": [1.5, 0.5, 1.2, 0.9, 3],
...         "width": [0.7, 0.2, 0.15, 0.2, 1.1],
...     },
...     index=["pig", "rabbit", "duck", "chicken", "horse"],
... )
>>> plot = df.plot(title="DataFrame Plot")

For SeriesGroupBy:

>>> lst = [-1, -2, -3, 1, 2, 3]
>>> ser = pd.Series([1, 2, 2, 4, 6, 6], index=lst)
>>> plot = ser.groupby(lambda x: x > 0).plot(title="SeriesGroupBy Plot")

For DataFrameGroupBy:

>>> df = pd.DataFrame({"col1": [1, 2, 3, 4], "col2": ["A", "B", "A", "B"]})
>>> plot = df.groupby("col2").plot(kind="bar", title="DataFrameGroupBy Plot")

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