text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

df = pd.read_csv('/kaggle/input/ufc-fights-2010-2020-with-betting-odds/data.csv')

df = df.dropna()

year_labels = []
for z in range(2010, 2021):
    year_labels.append(z)
fight_counts = []
for z in year_labels:
    fight_counts.append(len(df[df['date'].dt.year == z]))

plt.figure(figsize=(9, 5))
plt.plot(year_labels, fight_counts)
plt.xlabel('Year', fontsize=16)
plt.ylabel('# of Fights', fontsize=16)
plt.title('Fights Per Year', fontweight='bold', fontsize=16)
plt.show()