Recent Posts

  1. 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]')]:
        # apply(lambda x: x.replace(microsecond=0))
        df[col] = df[col].values.astype('datetime64[s]')

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

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

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

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

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

  6. Boston-bound for 2018

    Sun 10 September 2017

    Well, I never thought it would happen. Today I qualified for the Boston Marathon with a 3:00:04 showing at the Presque Isle Marathon.

Page 1 / 28 »