You may have seen ads for the Water Sort puzzle game. In case you haven’t, it’s a pretty standard puzzle game: you’ve got n+2 test tubes filled with n different colors. Your job is to pour from one test tube into another until the colors are all sorted out into their own test tubes. The only rule is you can only pour into a tube that is either empty or that has open space over another section of the same color.
We’ve all been there: you’re digging around for a freely-available data set that’s interesting, Goldilocks-sized, and has the right types of data fields to support your learning objectives. You’re an hour or two deep in searching, and nothing you find seemes quite right. What’s an instructional designer to do?
Well, if you’re me, the answer seems obvious: create a simulated data set to use in your examples. I’ve done this in technical writing contexts as well, when I needed to use “patient data” in some examples but of course could not use data for actual patients.
Working with Pandas DataFrames Pandas uses the DataFrame class for working with tabular data. DataFrames allow you to read, sort, manipulate, and display data. In this exercise, you’ll create your first DataFrame and use it to do some initial exploration of a data set.
Objectives When you finish this lab, you should be comfortable with:
Loading data into a DataFrame from a CSV file Printing out the first or last five rows Viewing DataFrame attributes like its columns and shape Accessing individual columns Manipulating the data set including sorting, ranking, and grouping Adding new columns and populating them with generated data Changing the data type of a column Filtering data by column values using loc and numerical or qualitative values We’ll build on these further in the next lab.
Have you ever wondered how many unique games of Tic-Tac-Toe there are? This question snuck into my brain the other day and I just had to find out. Come with me and see! My full source code for this exercise, including comments and random debugging notes that I omitted in this post, can be seen at https://replit.com/@KendraPendolino/TicTacToe.
Before we dive in, I want to talk a little bit about equivalent boards.
Kendra Creates is based on the Blackburn theme for Hugo. Blackburn is a sleek, light theme and a great starting point, but it didn’t include support for dark themes out of the box. In this post, we’ll look at how I added a dark theme to Kendra Creates.
Credit where credit is due - the code I wrote to add dark theme support is based on the process documented by Atanas Yonkov at Switching Off The Lights Part Two - Adding Dark Mode to Hugo.
When I first set up Kendra Creates, I went with the lowest barrier-to-entry: GitHub Pages, Jekyll, and a simple Jekyll theme. I made some changes and got everything set up, and quickly realized that I wanted something fuller featured. My husband, @dpendolino, recommended switching from Jekyll to Hugo to take full advantage of its features including post taxonomies and syntax highlighting. So I embarked on the process of switching to Hugo.
In the last year, I’ve gotten hooked on a new-to-me craft. Swedish weaving, also known as huck embroidery, first caught my attention years ago when I saw a cousin doing this very cool looking geometric embroidery on a throw blanket. I finally tried it over the summer of 2021 and discovered that it’s fun, works up quickly, and produces stunning results. Take a look for yourself:
Swedish weaving is worked on a fabric with vertical “floats” on the surface of the fabric.
Emboldened by my recent completion of Project Euler 96, I decided to take a crack at another problem: Problem 93. You can read the full text of the problem at the link above, but the gist of it is this: working with a set of four distinct individual digits, arranged in any order, with any combination of parentheses and basic mathematical operations (+, -, /, *), which combination of digits can form the longest string of consecutive positive integers from 1 to n before reaching an integer that can’t be formed using those digits?
Looks like this project is done! I plugged the semi-solved Grid 42 into a sudoku app to check for the next step, and immediately saw it: locked intersections. This happens when all of the candidates for a given digit in a box appear in the interesction of that box and a row/column or vice versa. If every cell that could contain a 1 in box 0 is in row 0, you know that the digit 1 can’t appear anywhere else in row 0.
WELL turns out I had a glitch in my code. Let’s recap where the last installment left off. My algorithm thought that this was fully solved:
829|31 |475 5 7|489|123 1 4|275|689 ---+---+--- 2 3|64 |9 7 461|927|538 97 |138|246 ---+---+--- 713|852|694 92|764|851 648|3 |7 2 So, that’s a miss. I went back through my code to identify the issue and discovered that there was a bug in my hiddenPairs code.