From 7c21f223f08750c664bfc93cf05b76fac5265f9c Mon Sep 17 00:00:00 2001 From: Teo Bucci Date: Mon, 25 Mar 2024 15:23:56 +0100 Subject: [PATCH] Simplify tigramite helper function --- hawk/analysis/pcmci_tools.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hawk/analysis/pcmci_tools.py b/hawk/analysis/pcmci_tools.py index 63a3859..67357c4 100644 --- a/hawk/analysis/pcmci_tools.py +++ b/hawk/analysis/pcmci_tools.py @@ -46,8 +46,10 @@ def initialize_tigramite_df(df: pd.DataFrame): :return: tigramite dataframe and variable names tuple """ - var_names = df.columns + dataframe = pp.DataFrame( + df.values, + datatime={0: np.arange(len(df))}, + var_names=df.columns, + ) - dataframe = pp.DataFrame(df.values, datatime={0: np.arange(len(df))}, var_names=var_names) - - return dataframe, var_names + return dataframe