Posts tagged python

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 ...


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 ...


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 ...