All Posts

Changing the Python version in conda

The latest version of Anaconda comes with Python 3.6. If you’re anything like me, you’re still getting over the shock of moving from 2.7. Fortunately, you can change the default version of Python in your root conda environment with a one-liner.

Read more ...


Adding a dimension to a tensor in PyTorch

As of version 0.1.10, PyTorch supports None-style indexing. You should probably use that. But if you prefer to do it the old-fashioned way, read on.

Read more ...


Sending a text message with SNS

SNS is AWS’ pub-sub service. It’s useful for sending and receiving alerts for events you care about. It can also be used to send SMS messages. If you’ve setup your AWS command-line tool, you can do this in 3 lines of Python.

Read more ...


Some cool IPython tips

The IPython shell is a fast way to evaluate small bits of code. It also functions as a mighty fine calculator. You can install it with pip, pip install ipython, and launch it with the ipython command. Besides the normal Python REPL stuff, here are a few cool things about the IPython shell.

Read more ...


PyTorch quick start: Classifying an image

In this post we’ll classify an image with PyTorch. If you prefer to skip the prose, you can checkout the Jupyter notebook.

Read more ...


Getting started with Amazon Web Services

  • 2017-02-25
  • aws

Amazon Web Services (AWS) provide a ton of useful tools for data science. This post will describe the two things you should do to get started: sign up and create a user. This will set you up to be able to use the command-line tool described in another post. Most of the services in AWS have a free tier, meaning you can try them out for some period of time without paying anything. But you will need to provide a credit card number and you should figure out the pricing details for every service before you use it.

Read more ...


AWS CLI quick start

  • 2017-02-14
  • aws

The Amazon Web Services (AWS) command line tool is a full-featured alternative to using the AWS console to perform actions in your account. Getting started is dead simple. I assume you have an AWS account and access to your Access Key ID and Secret Access Key. If that’s not true, you can read our getting started guide.

Read more ...


Running a Docker container

Once you’ve installed Docker, there a few basic features to know. In this post you’ll learn about running containers. If you haven’t gotten started with Docker yet, checkout this quick start guide.

Read more ...


Parentheses do not a tuple make

Tuples are immutable sequences in Python. One common way to create a tuple is to put comma separated values in between parentheses.

Read more ...


Docker quick start

Docker is a useful tool for creating small virtual machines called containers. Containers are instances of docker images, which are defined in a simple language. This language is usually written in a file called Dockerfile and it’s common practice to version control these files. When you run a container on your computer you get access to an entirely separate Linux environment. Better yet, you can run the same container on your laptop as you run code in production, giving you the opportunity to develop and test in a realistic environment. This takes one major source of uncertainty out of the process of running your code on another machine.

Read more ...


Install Python

Anaconda, from Continuum Analytics, makes maintaining your Python scientific computing stack easy. Installing Anaconda will give you both a solid distribution of Python (Anaconda) and a good Python package manager (conda).

Read more ...


Setup your Mac

On a Mac, any development environment has to include xcode-select and homebrew. You can install them with two shell commands.

Read more ...