Most recent version of pandas broke the code (all of the DataFrame.apply(numpy.*) and numpy.append() ), so the code was re-written using recent pandas functionality implemented from when the code was first written