[Solved] FREQUENCY BAR CHART OF A DATE COLUMN IN AN ASCENDING ORDER OF DATES


import pandas as pd
import matplotlib.pyplot as plt

data = pd.read_csv('dataset.csv')
data['sample_date'] = pd.to_datetime(data['sample_date'])
data['sample_date'].value_counts().sort_index().plot(kind='bar') # Use sort_index()

plt.tight_layout()
plt.show()

Sorted by date

0

solved FREQUENCY BAR CHART OF A DATE COLUMN IN AN ASCENDING ORDER OF DATES