Created
November 16, 2023 01:27
-
-
Save galenseilis/80e766961261121f014bb9743d0a95c0 to your computer and use it in GitHub Desktop.
is_contiguous_dates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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