Created
January 19, 2023 02:27
-
-
Save mattdahl/a563a48ac512275d893907dd19acd4ae to your computer and use it in GitHub Desktop.
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
from courts_db import courts | |
# Get all citation strings | |
court_strings = [c['citation_string'] for c in courts if c['citation_string'] != ''] | |
# How many existing collisions are there? | |
len(court_strings) - len(set(court_strings)) # Returns 148 | |
# Remove the existing collisions | |
court_strings = list(set(court_strings)) | |
# Strip out whitespace from each string | |
court_strings_stripped = [c.replace(' ','') for c in court_strings] | |
# Test for new collisions | |
len(set(court_strings_stripped)) == len(court_strings) # Returns True, i.e., no new collisions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment