Skip to content

Instantly share code, notes, and snippets.

@galenseilis
Created November 16, 2023 01:27
Show Gist options
  • Save galenseilis/80e766961261121f014bb9743d0a95c0 to your computer and use it in GitHub Desktop.
Save galenseilis/80e766961261121f014bb9743d0a95c0 to your computer and use it in GitHub Desktop.
is_contiguous_dates
def is_contiguous_dates(dates):
start_date = dates.min()
end_date = dates.max()
date_range = pd.date_range(start=start_date, end=end_date)
diff = date_range.difference(dates)
if diff.size:
return False
else:
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment