Curriculum
Course: Pandas
Login
Text lesson

Pandas Plotting

img_pandas_plot

Plotting

Pandas utilizes the plot() method to generate diagrams, and we can use Pyplot, a submodule of the Matplotlib library, to display the diagram on the screen.

Example

Import Pyplot from Matplotlib to visualize the DataFrame.

import pandas as pd
import matplotlib.pyplot as plt

df = pd.read_csv(‘data.csv’)

df.plot()

plt.show()

The examples on this page use a CSV file named “data.csv”.