Other articles

  1. Subtotals and Grouping with Pandas

    For a long time, I've had this hobby project exploring Philadelphia City Council election data. I've learned no agency has this data collected or maintained in a consistent, normalized manner. From election to election, vote counts are presented in different ways (as explored in this blog post), candidate names are …

    read more
  2. Looping through Python command line arguments

    I have a Python script that does some image manipulation and outputs a new file. From the command line, it takes two arguments, the old file and new file:

    python image_converter.py oldfile.jpg newfile.jpg
    

    I wanted to run this over a bunch of files, and used this bash …

    read more
  3. Making files by the batch

    I had a list of names and I wanted to create an empty file with each of those names.

    First I saved my list of names to a file with the .md extension since they were all going to be markdown files.

    names.txt

    barack.md
    joe.md
    hillary.md …
    read more
  4. Stashing revisions in Git

    Tue 22 November 2016 | tags: git |

    Sometimes I'll be working on a project, having moved along a few steps from my last commit, only to remember there was something else I wnated to do before the point I'm at now. Since the point I'm at now isn't really ready for a commit, I don't want to …

    read more
  5. Django Databases and Date Ranges

    I'm continuing to work on my project analyzing data about Philadelphia City Council - elections, demographics, terms of service, etc., even as heartbroken and terrified I am about the recent Presidential election. A very crude version of this project is here. A big thing that this never did was to look …

    read more
  6. Jupyter Notebook and the Django shell

    I've been working on a project analyzing data about Philadelphia City Council - elections, demographics, terms of service, etc. A very crude version of this project is here. I want to make this more robust, and a big part of doing so includes playing with code. One of my favorite ways …

    read more
  7. If __name__ == __main__

    Tue 01 July 2014 | tags: Python |

    When you work in python, you’ll see this if __name__ = '__main__' all over the place. It took me forever to really understand what it means. Actually, I still often have to think through each time I see or use it (but I don’t really use it myself).

    I …

    read more

Page 1 / 2 »

social