aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gn3/computations/partial_correlations.py2
-rw-r--r--tests/unit/computations/test_partial_correlations.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/gn3/computations/partial_correlations.py b/gn3/computations/partial_correlations.py
index 07a67be..156e74c 100644
--- a/gn3/computations/partial_correlations.py
+++ b/gn3/computations/partial_correlations.py
@@ -273,7 +273,7 @@ def build_data_frame(
if isinstance(zdata[0], float):
return x_y_df.join(pandas.DataFrame({"z": zdata}))
interm_df = x_y_df.join(pandas.DataFrame(
- {"z{}".format(i): val for i, val in enumerate(row)} for row in zdata))
+ {"z{}".format(i): val for i, val in enumerate(zdata)}))
if interm_df.shape[1] == 3:
return interm_df.rename(columns={"z0": "z"})
return interm_df
diff --git a/tests/unit/computations/test_partial_correlations.py b/tests/unit/computations/test_partial_correlations.py
index 7cf8cd8..f25145c 100644
--- a/tests/unit/computations/test_partial_correlations.py
+++ b/tests/unit/computations/test_partial_correlations.py
@@ -392,8 +392,8 @@ class TestPartialCorrelations(TestCase):
((5.1, 6.1 ,7.1), (5.2, 6.2, 7.2), (5.3, 6.3, 7.3)),
pandas.DataFrame({
"x": (0.1, 1.1, 2.1), "y": (2.1, 3.1, 4.1),
- "z0": (5.1, 5.2 ,5.3), "z1": (6.1, 6.2 ,6.3),
- "z2": (7.1, 7.2 ,7.3)}))):
+ "z0": (5.1, 6.1, 7.1), "z1": (5.2, 6.2 ,7.2),
+ "z2": (5.3, 6.3 ,7.3)}))):
with self.subTest(xdata=xdata, ydata=ydata, zdata=zdata):
self.assertTrue(
build_data_frame(xdata, ydata, zdata).equals(expected))