Skip to content

Commit

Permalink
pylinter error solved, make contrast_df column ordering consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
GStechschulte committed Jul 6, 2023
1 parent b074df6 commit 614b511
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bambi/plots/effects.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def _build_contrasts_df(

lower = []
upper = []
for pair, val in zip(contrast_keys, contrast_estimate.hdi.values()):
for pair in contrast_keys:
if use_hdi:
lower.append(
(
Expand All @@ -390,6 +390,9 @@ def _build_contrasts_df(
contrast_df[covariate_cols] = np.transpose(covariate_vals)
contrast_df[response.lower_bound_name] = np.array(lower).flatten()
contrast_df[response.upper_bound_name] = np.array(upper).flatten()
contrast_df.insert(
len(contrast_df.columns) - 3, "estimate", contrast_df.pop("estimate")
)
contrast_df = enforce_dtypes(model.data, contrast_df)

contrast_df["contrast"] = contrast_df["contrast"].apply(tuple)
Expand Down

0 comments on commit 614b511

Please sign in to comment.