Marginal Effects: Fix invalid key in python error