aboutsummaryrefslogtreecommitdiff
path: root/gn3
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2021-11-15 07:06:58 +0300
committerFrederick Muriuki Muriithi2021-11-15 07:06:58 +0300
commit63b70daaffd2c3e095fde3ed59a07bb9ee894c4f (patch)
treeafd40ef9761924abf6fd6b5283b1f9492d5336e1 /gn3
parentd1617bd8af25bf7c7777be7a634559fd31b491ad (diff)
downloadgenenetwork3-63b70daaffd2c3e095fde3ed59a07bb9ee894c4f.tar.gz
Fix the columns in built data frame
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * When the z value is a Sequence of sequences of values, each of the internal sequences should form a column of its own, and not a row, as it was originally set up to do.
Diffstat (limited to 'gn3')
-rw-r--r--gn3/computations/partial_correlations.py2
1 files changed, 1 insertions, 1 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