Reweighting (rake) in Python

817 views Asked by At

I'm looking for a python library for replace the rake function from "Survey", an R library (https://www.rdocumentation.org/packages/survey/versions/4.0/topics/rake)

I have found and try Quantipy, but the weights quality is poor compared to the weights generate with R on the same dataset. I have found PandaSurvey, but seems to not working correctly (and the documentation is very poor)

I am surprised not to find much on google on this subject. However, it is an essential function if you are working with polls. Python being a datascience language, it's surprising. But maybe I missed it.

Thank you very much!

1

There are 1 answers

1
Ash On

I know it's an old post, but it may help others. I used IPFN library to calculate weight for my sample dataset based on a targeted population. I think it may suit your needs.