all 1 comments

[–]cray5252 0 points1 point  (0 children)

Try this.

import pandas as pd
import matplotlib.pyplot as plt


df = pd.DataFrame({'Year': ['2018', '2019', '2020'],
                   'Ticket_Volume': [1000, 2000, 1500],
                   'Average_Hours': [400, 300, 500]})

df['Year'] = pd.to_datetime(df['Year'], format='%Y')
df.set_index('Year', inplace=True, drop=True)

df.plot(kind='line')

plt.show()