Maybe SF's best sandwich was the friends we made along the way
Streamlit + Sandwiches + Prompting + Friends
Last week while I was chatting with my buddy Rob I realized I hadn’t done a ‘purely for the fun of it’ data science project in quite a while. I used to be the data project guy, scraping apps for their pizza data and listening to hundreds of podcasts to figure out our perception of kindness! I’m currently working on a project where I try to make subscription Streamlit apps, and am in the middle of writing the second version of my book, but the same thrill wasn’t there. Those are the B2B SAAS style projects at best, interesting and valuable but a little boring.
In comes the idea: a competition for the best sandwich competition in SF. I was inspired by three main things.
My coworkers (Zachary and Tyler) finding my old ping pong blog post and lightly roasting me for the code quality (give me a break, I was just learning Python)
My favorite bakery in SF (Thorough Bread) unjustifiably coming in third in the SF Croissant competition
I have a goal this year to get in the habit of hosting, and am deeply behind. I did a mid-year check in with a group of my friends and had to tell them I had hosted only a single event this year so far. Not great!
So a sandwich competition it was. I immediately texted Nikhil Thota, who lives in the Mission Control coliving house and agreed to let us use his place to host. which is large enough for quite a few people. I’m subletting a friend’s place in SF that probably isn’t big enough, so this was a godsend.
Next, I needed to decide on the list of sandwiches. Do we include the almighty bagel? Should we add a Banh Mi? What about a friend chicken sandwich?
I ended up employing the consultation of the man with the best overall taste in SF, Gonzalo Nuñez. He has a famously good SF food list that is not public, but I heard if you get in the next funding round at Rewind I think you get that perk for free. Word on the street. Either way, we came up with the final list.
The list being complete, I now needed to figure out how to
Design a sandwich ranking strategy
Take in user ratings
Compute and visualize the results in real time
#1 is not that tricky but there are some stipulations! We have too many sandwiches for every person to try every sandwich. We also know that everyone’s ratings will not be calibrated, such that every participant’s 8 will be at a different quality bar. My 7 is your 9, so the average across sandwiches is mostly useless.
Luckily for us, Chess has solved this problem already with the Elo rating. Elo assumes all ratings are head to head, only recording the winner and loser. It also does not care if one sandwich happens to get more matchups than another (which, given the logistical difficulties presented, is a huge perk). And there are a half dozen python libraries that implement it, making it wildly easy to use.
With the ranking issue out of the way, I wanted to be able to take in user’s ratings. This also was not very difficult in Streamlit, thanks to the new st.data_editor
widget which allows for a spreadsheet like interface. I just needed to randomize the attendee<>sandwich pairings
and then made a new data editor for each “round” of sandwich competition. I also wrote a little bit of hacky code to save the data as a csv if I needed to save my state, I was paranoid about losing the data from the editor which would happen if someone accidentally closed the app!
Now the input app looked something like this for each round. We had a few walk in attendees, which were easy to add with the data editor.
This way, every round had its own editable spreadsheet and while we were eating sandwiches, I could go around and ask people which one they liked more. People also could fill it out themselves, but it was just easier for me to do it.
The final bit was computing the Elo score and visualizing the final results. Thankfully, the elosports package makes it super easy to access your entire Elo history per player (sandwich shops in our case).
And then voila! Our event was planned. Nikhil and I set up a partiful, Shelby was kind enough to make an event flyer, and Serin / Ashni helped pick up the sandwiches day of.
There were a couple hiccups, like Turner’s being closed and therefore being removed from the competition, but the event turned out smoothly.
We ate the sandwiches, used the app (hosted at sandwich.streamlit.app), and got our results.
Surprising Results:
My favorite bakery came in dead last. This was, to say the least, pitiful. I blame myself for their performance, as I ordered the pulled pork which did not deal well with being left out relative to the cold sandwiches (Lucinda’s and Schlock’s were both designed to be cold). I maintain that their pulled pork sandwich is their best, but would have chosen differently if I had better foresight.
I was also surprised at El Metate’s and Tartine’s performances, as Tartine truly makes an excellent spicy turkey sandwich and RT Rotisserie’s performance led me to believe that the milanesa torta at El Metate could have pulled through. But the timing and heat difference factored into their performances as well.
After showing these results to our taste maker (Gonzi), he was shocked at the low performance of Hazel and blamed me for ordering the wrong sandwich. This is a fair critique but I refuse to get chirped at from the peanut gallery that is his weekend Tahoe trip. It is not the critic who counts. The credit belongs to the man who is actually in the arena, whose face is marred by tomato and dutch crunch. Or whatever Roosevelt said.
You can run your own sandwich competition with this GitHub repo and you can see our results at sandwich.streamlit.app.
Maybe SF's best sandwich was the friends we made along the way
"The credit belongs to the man who is actually in the arena, whose face is marred by tomato and dutch crunch."
Gottem @gonzi