Created
July 14, 2022 18:24
-
-
Save theavey/9e898e250700056d4f60717784a411d1 to your computer and use it in GitHub Desktop.
some simple code to narrow down remaining wordle solutions
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 pandas as pd | |
words = pd.read_table( | |
"https://static.nytimes.com/newsgraphics/2022/01/25/wordle-solver/assets/solutions.txt", | |
header=None, | |
)[0] | |
letters = "[qwtyuiopdfghjkzxvbnm]" | |
words[ | |
words.str.match( | |
f"{letters.replace('t', '')}" | |
f"{letters.replace('o', '')}" | |
f"{letters.replace('i', '')}" | |
f"{letters.replace('n', '')}" | |
f"{letters}" | |
) | |
& words.str.contains("o") | |
& words.str.contains("i") | |
& words.str.contains("t") | |
& words.str.contains("n") | |
].str.split( | |
"", expand=True | |
) # .drop(columns=[0, 6]).sort_values([1, 2, 3, 4, 5]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment