$ 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?
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.
Using Arduino, Python, and AWS
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…
In April 2021 I was granted the privilege of unboxing a brand new 2020 M1 Apple MacBook Air.
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. …
Is it really that simple?
I am seeing folks frustrated with lack of native support for data science libraries:
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.
Here’s the 9-step-process that seems to be working for me right now:
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:
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.
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…
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…
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…
Data Scientist // @cinemarob1