Data Science, Machine Learning, Causality, Causal Inference, Python.
really a hack — ideally, I’d make the change on the aggregation function, something like DataFrameGroupBy.zmean(), but I’d have to extend the groupby method to return a new, extended DataFrameGroupBy object. I’ll probably do that eventually, but wanted to get this version out there for now. How it