Created
January 16, 2023 00:58
-
-
Save Radcliffe/110e7a7afaa6cd413e493409683ed524 to your computer and use it in GitHub Desktop.
Count knots with Arf invariant zero by crossing number
This file contains hidden or 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
import csv | |
import requests | |
from collections import Counter | |
import json | |
url = 'https://raw.githubusercontent.com/soehms/database_knotinfo/main/database_knotinfo/csv_data/knotinfo_data_complete.csv' | |
with requests.Session() as session: | |
download = session.get(url) | |
decoded = download.content.decode('utf-8') | |
reader = csv.DictReader(decoded.splitlines(), delimiter='|') | |
data = list(reader) | |
counts = Counter(int(row['crossing_number']) for row in data if row['arf_invariant'] == "0") | |
for crossing_number, count in sorted(counts.items()): | |
print(crossing_number, count) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment