Recent Posts

  1. Writing LaTeX in Atom

    Fri 20 July 2018

    Atom is a code editor. The defaults try to "complete" words from your writing, and don't highlight spelling. After many months of using a code editor to write, it's clear that I've gone backwards and I should at least be using spell checking!

    These two settings vastly improve the latex …

  2. Tricks for coercing Pandas into parquet

    Tue 29 May 2018

    For coercing pandas date times (stored as numpy datetime):

    for col in df.columns[df.dtypes == np.dtype('<M8[ns]')]:
        # https://stackoverflow.com/questions/32827169/python-reduce-precision-pandas-timestamp-dataframe
        # apply(lambda x: x.replace(microsecond=0))
        df[col] = df[col].values.astype('datetime64[s]')
    

    For coercing python datetime (here, a datetime.date, there …

  3. How to groupby in Pandas with a missing group

    Wed 25 April 2018

    This is a note intended for my future self. Here’s how to do it:

    1. Have a list of the values that you expect for each group.
    2. Iterate over that list, and look up the values using .loc.

    Say I want to group by months, but not all of the …

  4. Boston 2018

    Mon 16 April 2018

    This was an incredible experience.

    The crowds were just amazing, and seeing my son Olson at mile 6 in the rain and cold was amazing. With the weather, Olson on my mind, and the huge crowds, parts of the race were very emotional.

    At about mile 11-13, I sped up …

  5. Linking files from GitHub in CodePen

    Wed 08 November 2017

    In the course I teach at UC Berkeley in the MIDS program, we use CodePen to build interactive web graphics. There are a host of reasons to use CodePen, but setting that aside for now, let's talk about how to host data files for CodePen. CodePen lacks a way for …

  6. Welcome Olson Stanley Reagan

    Wed 11 October 2017

    Today my wife Sam gave birth to our first son, Olson Stanley. He was born at 11:45AM, weighing 6 pounds and 9 ounces, at 20 some inches of length.

    Mom and baby are happy and healthy and we are excited for this new chapter in our lives!

Page 1 / 28 »