Skip to content

Instantly share code, notes, and snippets.

@ageller
Created December 20, 2021 22:19
Show Gist options
  • Save ageller/54cbc157ad25e1fd52446cc952ae8144 to your computer and use it in GitHub Desktop.
Save ageller/54cbc157ad25e1fd52446cc952ae8144 to your computer and use it in GitHub Desktop.
create a histogram with dates
import matplotlib.pyplot as plt
import numpy as np
f, ax = matplotlib.pyplot.subplots()
minDate = np.datetime64('2011-01-01')
maxDate = np.datetime64('2019-01-01')
bins = np.arange(minDate, maxDate, np.timedelta64(1, 'M'),  dtype = 'datetime64[M]')
ax.hist(df['CREATION DATE'], bins = bins, orientation = 'horizontal')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment