I am wondering if anybody can help me work on my pandas style. I am trying to do an operation on groups of data within a panda, like in the following example.