I want to do some basic summary statistics on a non-binary variable with weights. I have an earnings data and after I use groupby()
by demographic groups, I want to do something like describe()
, but with weights.
In Using describe() with weighted data and pandas: groupby and variable weights, the OPs asked very similar questions, but the answers have been insufficient. In my case I want the percentile distribution including the median so multiplying the variable of interest with the weights won't work.
Given how much of data analysis is done with weights, I find it difficult to believe there is no easy way to work with weights and want to try my luck here!