I am wondering if the following can be achieved using Pandas vectorization, and if so what the code would be. I believe the code would be fairly straightforward if I were to use