Need help calculating statistics with WT06 in Python

While I don’t have experience with python, you might find this forum post on calculating weighted estimates with python code helpful. You should be able to adapt it by substituting WT06 for ASECWT and RWT06 for REPWTP (you can read more about replicate weights in the RWT06 variable description tab as well as on IPUMS CPS).

This solution is different than using svy in Stata or svyr in R, as this is a one-time calculation for a single estimate that functions differently from those other libraries. Many commands in pandas have a weights key word argument and the statsmodels library has the ability to apply frequency weights for as well - the DescrStatsW class may be of help for descriptive statistics and simple hypothesis testing: statsmodels.stats.weightstats.DescrStatsW - statsmodels 0.15.0 (+306)