modify to use pandas DataFrames instead of la labeled arrays