From 12d4bec7f2a41f2e7a7fba091b4e78b5af0f5b01 Mon Sep 17 00:00:00 2001 From: bekojuniranjan Date: Fri, 13 Feb 2026 11:11:18 -0800 Subject: [PATCH] Bug Fix: use iloc to index pd.Series --- causalml/dataset/synthetic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/causalml/dataset/synthetic.py b/causalml/dataset/synthetic.py index 983784fd..358ebb29 100644 --- a/causalml/dataset/synthetic.py +++ b/causalml/dataset/synthetic.py @@ -544,10 +544,10 @@ def scatter_plot_summary_holdout( for g in np.unique(group): ix = np.where(group == g)[0].tolist() - ax.scatter(xs[ix], ys[ix], c=cdict[g], label=g, s=100) + ax.scatter(xs.iloc[ix], ys.iloc[ix], c=cdict[g], label=g, s=100) for i, txt in enumerate(plot_data.label[:10]): - ax.annotate(txt, (xs[i] + 0.005, ys[i])) + ax.annotate(txt, (xs.iloc[i] + 0.005, ys.iloc[i])) ax.set_xlabel("Abs % Error of ATE") ax.set_ylabel("MSE")