Skip to content

Instantly share code, notes, and snippets.

@alexprengere
alexprengere / main.py
Created April 26, 2017 08:59
Genetic algorithm example
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Code from https://lethain.com/genetic-algorithms-cool-name-damn-simple
"""
from random import randint, random
from operator import add
@alexprengere
alexprengere / check_missing_cities.py
Last active April 30, 2020 06:43
Check airports not connected to a big city
from neobase import NeoBase
N = NeoBase()
for key in N:
N.set(key, city_codes=set(N.get(key, "city_code_list")))
for key in sorted(N):
if "A" not in N.get(key, "location_type"):
continue