Using a Virtual Environment to Avoid Seeming like a Sadist

TL;DR: $ pip freeze > requirements.txt

Why not just write pretty code and push it to GitHub like a happy little clam, and not worry about making a requirements.txt? If my code runs on my computer, why should I give a care about my python environment? What even is a python environment? Perhaps a reticulated python’s terrarium?

There’s a happy little clam, in her environment

Nope. In short, we generate and share requirements.txt files to make it easier for other developers to install the correct versions of the required Python libraries (or “packages”) to run the Python code we’ve written.

Open-source python packages — like beautifulsoup, or jupyter


Using Arduino, Python, and AWS

Arduino (ESP-32) Subway Clock

The year is ~2018. I take a class at my local hackerspace, NYC Resistor. They give a little presentation about the history of IoT devices. They guide us through breadboarding our own little MTA train time arrival clocks, which behave like the ones on the ceilings at Subway stations—except it sits on your desk, or whatever. Neat!

The kit they prepare for us consists mainly of an ESP32 Arduino module (which has WiFi), a tiny OLED screen, and a bunch of great C++ code to parse the MTA’s nasty protobuf feed with the esp32's limited…


Love to hear it! What is everything, for you?


A Python/Pandas guy sets up shop on Apple Silicon

Image evoking craftsmanship!

In April 2021 I was granted the privilege of unboxing a brand new 2020 M1 Apple MacBook Air.

Why Mac?

I would have considered an Ubuntu setup, but I’m a sucker for some commercialized mac/win-only apps like Adobe Lightroom. I considered switching to Windows (and making use of WSL2): That way, I could still have my stupid GUI apps plus a Linuxy dev environment, then splurge on hardware. But there’s just a special something about the industrial design of MacBooks! I like how effortless it is to throw a MacBook air in a backpack, to bring it with you. …


with brew Python 3.8.x, in a regular virtual environment

Image via PixaBay.com under Creative Commons

Intro

I try to avoid (ana)conda when I can. I prefer PyEnv.

Lately, I’ve found myself repeatedly fumbling trying to get Jupyter up and running and packages like pandas importing properly. Maybe this had to do with recent upgrades to my OS (to Catalina) or switching from bash to zsh as my primary shell. In any case, I’d like to lay out some steps to repeatably getting jupyter notebooks running on OSX Catalina, in a normal (brew/pyenv) python virtual environment, without conda.

Steps Overview

Here’s the 9-step-process that seems to be working for me right now:

  1. Via zsh: Install homebrew
  2. Via homebrew: Install…


Serverless Infrastructure as Code via AWS CloudFormation

2020–09–10

When I used to work at a Data Analytics firm in Times Square, I’d frequently enjoy lunch on the beautiful Bryant Park Lawn. I could check https://bryantpark.org/ to see if the lawn was currently open, but the org page loaded somewhat slowly; it was full of images I didn’t care about.

Because of this (and a desire to learn AWS things), I spun up a dumb single-serving website from an ec2 box, which just said whether or not the lawn was open. You’d go to “is the bryant park lawn open dot com” and see this:

Inspired by http://hasthelargehadroncolliderdestroyedtheworldyet.com/

In the malaise of…


Home Automation // My First Arduino Project

Tl;dr: I covered the perimeter of my apartment hallway in fancy LED strips. I installed motion sensors above all the doorways. I wrote a bunch of Arduino code. Now when you trip one of the motion sensors, the hallway lights up from that point outward, creating a “runway” effect. This is how.

2019–04–10: BEGIN PROJECT LOG

A few weeks ago I took an intro to Arduino class at my local hackerspace, NYC Resistor, and got inspired!

I’d like to install motion sensors and smart LED strips in our apartment’s entrance hallway. I’ll make them do a runway/chase effect, where the lights spark up sequentially…


But I’ve been Looking for a While and Haven’t Found Much Yet.

The most detailed film production data I’ve been able to find is on WikiLeaks, like this budget for Unforgettable Season 3, and this budget for The Interview:

That there is some high-resolution budget data

I’m not even supposed to be able to see these two line-item film budgets, but I want thousands. Where do I find them? How do I open the floodgates?

Data science bootcamp students often do toy projects relating to movies, because everybody loves movies duh, and because there’s always a nice kaggle-style tabular movie dataset readily available within the first few pages of web search results. There’s OMdB, where you can query a…


Also Featuring: What and Why

When you write code, primarily, you want for it to work, and secondarily, you want for it to work efficiently. Efficient code minimizes those situations where you’re sitting there waiting for your script to run, wondering if you could have written more efficient code and spent the extra time sleeping, dreaming of rainbow unicorns. Efficient code is also just less likely to fail. We like that.

For example, sometimes, it’s better to use generator expressions than list comprehensions in Python—especially when you don’t need the list implicitly created by a list comprehension.

For example, if you were to run a…

Robert Boscacci

Data Scientist // @cinemarob1

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store