Author Archives: zacharysteinertthrelkeld

Peak Design Everyday Backpack is not an Everyday Bag

That headline misleads slightly: the 30L backpack is a good everyday bag if photography is part of your everyday.  If your everyday involves traditional office work and commuting, I suggest looking elsewhere for a bag.  That is what I did, and I own happily the Nomatic Backpack. The internet world is in love with all […]

group_by() %>% mutate() using pandas

While I have my issues with the tidyverse, one feature I am enamored with is the ability to assign values to observations in grouped data without aggregating the data.  This assigning is done by using the mutate() command instead of summarize().  I am in the middle of some data processing in a Python pipeline where I […]

Python, if any() else in list comprehension

This one took me about 20-30 minutes to figure out today and required stringing together some SO answers, so I’m putting what I learned here for future reference. The scenario: searching if 1 of multiple strings exists in a longer string.  In this case, some possible Twitter clients in the source field of a tweet […]

Multiple nohup.out Files

This entry is a reminder for myself more than anything, as it documents a very popular SO answer that is one of the first returns from Google when searching “nohup multiple out files”. nohup.out is a file created automatically when you use type “nohup” in a bash terminal.  (“nohup” is short for “no hangup”, which […]

What I Read, 2018 Edition

Following my highly successful – I liked it, I mean – 2017 end of year book list, I have decided to make the post a tradition.  What follows is the list, in chronological order, of books I finished in 2018.  If I put an asterisk after the title, it means I started the book in 2017. American […]

Who I Saw, 2018 Edition

My wife has supernatural face memory and always sees celebrities when we are together. I am sure I saw many more celebrities without realizing it.  Overall, fun sightings, but not as awesome as 2017 (Fred Armisen, Jemaine from New Zealand and Flight of the Conchords, Abbi from Broad City). The following entries are in chronological order. Josh Flagg (January) […]

Assign Country Code to Tweets Based on GPS Coordinates

[UPDATE: THE BELOW CODE WAS DESIGNED FOR TWEETS THAT HAD BEEN ALREADY FORMATTED TO .CSV.  I HAVE UPDATED THE CODE TO WORK WITH RAW TWEETS.  THE GITHUB PAGE HAS LIKEWISE BEEN UPDATED.] When looking at tweets, it is often important to know where the tweet was created.  For tweets with GPS coordinates, Twitter is nice […]

Placing Text Within an R Plot

I often add text in plots. This text can be a legend or labeling certain points, in which case assigning it x and y coordinates are easy. Often times, the text is descriptive, e.g. the slope of a line or the number of observations in a sample. Customizing (x,y) coordinates in that case is simple […]

ggstance for Two Treatment Effects

I was making a plot comparing how five outcomes varied by whether they occurred during Period 1 or Period 2.  I wanted to plot the standard error of each point, which would often cause points to become hidden by the error bars.  The obvious answer is to shift the 10 points (5 outcomes, 2 treatments) […]

Add Interaction Variables as Needed

In today’s edition of Becoming a Functional Data Analyst, I am writing to remind myself not to create interaction variables during data munging.  That is, when acquiring, cleaning, and aggregating data, I find it easier to not interact variables I will later need.  Instead, it is easier to keep variables as they are and only […]