Skip to content

Instantly share code, notes, and snippets.

@zwegner
zwegner / anti_wordle.py
Last active January 27, 2022 00:53
Prove adversarial wordle has no 3-move solutions
# Proof of optimality of 4-move solution to adversarial Wordle
# https://qntm.org/files/wordle/index.html
import array
import collections
with open('wordle-words.txt') as f:
normal_words = [word.strip() for word in f]
with open('wordle-fake-words.txt') as f:
all_words = [word.strip() for word in f] + normal_words
@softwaredoug
softwaredoug / i-dont-like-nbdev.md
Last active December 29, 2023 14:32
These are just notes from learning nbdev, that may turn out to be false, and I encourage that feedback.

I am working on a project contemplating the best use of notebooks in our search relevance workflow. We're a cross-disciplinary team of software engineers and data scientists. Recently, to decide best practices, I watched the two famous talks I don't like Notebooks by Joel Grus and I like notebooks by nbdev creator Jeremy Howard. As a senior dev, I want to have opinions for how my team should develop both the notebooks and any underlying libraries.

Positive things about nbdev and notebooks

  • Writing docs leads to better code - I have written better code when I know its being consumed as documentation by others, and needs to be read. I fully agree with the amazing feedback loop between writing and coding that creates much better libraries
  • Jupyter as a dev env - For some people, Jupyter is their preferred dev environment, and should be supported as such.
  • Philosophy - I generally agree with the philo
@russellsamora
russellsamora / us_county_latlng.csv
Last active November 29, 2023 07:57
US counties with fips code, name, and lat lng
fips_code name lng lat
01059 Franklin -87.843283 34.44238135
13111 Fannin -84.31929617 34.86412558
19109 Kossuth -94.20689787 43.20413984
40115 Ottawa -94.81058917 36.83587796
42115 Susquehanna -75.80090451 41.82127676
40053 Grant -97.78493404 36.79651364
31029 Chase -101.6979407 40.52371008
29213 Taney -93.04127586 36.65473646
32510 Carson City -119.7473502 39.15108405
@conormm
conormm / r-to-python-data-wrangling-basics.md
Last active April 24, 2024 18:22
R to Python: Data wrangling with dplyr and pandas

R to python data wrangling snippets

The dplyr package in R makes data wrangling significantly easier. The beauty of dplyr is that, by design, the options available are limited. Specifically, a set of key verbs form the core of the package. Using these verbs you can solve a wide range of data problems effectively in a shorter timeframe. Whilse transitioning to Python I have greatly missed the ease with which I can think through and solve problems using dplyr in R. The purpose of this document is to demonstrate how to execute the key dplyr verbs when manipulating data using Python (with the pandas package).

dplyr is organised around six key verbs: