Pandas: Better performance on `diff()` over grouped data

Recently, I needed to do small manipulation on a relatively big data frame. In this data frame, I had cumulated revenues per some dimensions/categories and I wanted to calculate discrete...

Pandas: Group and aggregate when some data is missing

While crunching data, now and then we group data based on certain variables(usually dimensions) and generate some summarized variables(usually metrics). pandas usually works quite nicely but in some cases, results...