diff --git a/build/lib/lyzr/base/prompts/analysis_steps_pt.txt b/build/lib/lyzr/base/prompts/analysis_steps_pt.txt index 910e5c8..750ab42 100644 --- a/build/lib/lyzr/base/prompts/analysis_steps_pt.txt +++ b/build/lib/lyzr/base/prompts/analysis_steps_pt.txt @@ -17,7 +17,7 @@ B. The value of "steps" should be a list of dictionaries. Each dictionary should 2. Task: The task to be performed. The task can be one of the following: "clean_data", "transform", "math_operation", "analysis" 3. Type: The type of task to be performed. 3a. For task "clean_data", following types are available: "convert_to_datetime", "convert_to_numeric", "convert_to_categorical" - 3b. For task "transform", following types are available: "one_hot_encode", "ordinal_encode", "scale", "extract_time_period" + 3b. For task "transform", following types are available: "one_hot_encode", "ordinal_encode", "scale", "extract_time_period", "select_indices" 3c. For task "math_operation", following types are available: "add", "subtract", "multiply", "divide" 3d. For task "analysis", following types are available: "sortvalues", "filter", "mean", "sum", "cumsum", "groupby", "correlation", "regression", "classification", "clustering", "forecast" 4. Args: The arguments required to perform the task. The arguments should be in the form of a dictionary. diff --git a/build/lib/lyzr/base/prompts/plotting_steps_with_analysis_pt.txt b/build/lib/lyzr/base/prompts/plotting_steps_with_analysis_pt.txt index f092b3e..b0057d4 100644 --- a/build/lib/lyzr/base/prompts/plotting_steps_with_analysis_pt.txt +++ b/build/lib/lyzr/base/prompts/plotting_steps_with_analysis_pt.txt @@ -15,7 +15,7 @@ A. The value of "preprocess" should be a dictionary with keys "df_name" and "ste 2. Task: The task to be performed. The task can be one of the following: "clean_data", "transform", "math_operation", "analysis" 3. Type: The type of task to be performed. 3a. For task "clean_data", following types are available: "convert_to_datetime", "convert_to_numeric", "convert_to_categorical" - 3b. For task "transform", following types are available: "one_hot_encode", "ordinal_encode", "scale", "extract_time_period" + 3b. For task "transform", following types are available: "one_hot_encode", "ordinal_encode", "scale", "extract_time_period", "select_indices" 3c. For task "math_operation", following types are available: "add", "subtract", "multiply", "divide" 3d. For task "analysis", following types are available: "sortvalues", "filter", "mean", "sum", "cumsum", "groupby", "correlation", "regression", "classification", "clustering", "forecast" 4. Args: The arguments required to perform the task. The arguments should be in the form of a dictionary. diff --git a/build/lib/lyzr/data_analyzr/analyzr.py b/build/lib/lyzr/data_analyzr/analyzr.py index e956f62..97ccdd7 100644 --- a/build/lib/lyzr/data_analyzr/analyzr.py +++ b/build/lib/lyzr/data_analyzr/analyzr.py @@ -360,10 +360,11 @@ def visualisation( self.logger.info("Fetching dataframes from database to make visualization.") self.df_dict = self.database_connector.fetch_dataframes_dict() plot_df = self.df_dict - df_keys = list(self.df_dict.keys()) - for key in df_keys: - k_new = key.lower().replace(" ", "_") - self.df_dict[k_new] = self.df_dict.pop(key) + if plot_df is not None: + df_keys = list(plot_df.keys()) + for key in df_keys: + k_new = key.lower().replace(" ", "_") + plot_df[k_new] = plot_df.pop(key) self.visualisation_output = None self.start_time = time.time() diff --git a/build/lib/lyzr/data_analyzr/db_connector.py b/build/lib/lyzr/data_analyzr/db_connector.py index 30d12ff..148c453 100644 --- a/build/lib/lyzr/data_analyzr/db_connector.py +++ b/build/lib/lyzr/data_analyzr/db_connector.py @@ -475,6 +475,14 @@ def create_database(self, db_path: str, df_dict: dict[pd.DataFrame]): try: self.conn = sqlite3.connect(self.db_path, check_same_thread=False) for name, df in df_dict.items(): + df = df.rename( + columns=dict( + zip( + df.columns, + [col.replace(" ", "_").lower() for col in df.columns], + ) + ) + ) df.to_sql(name, con=self.conn, index=False, if_exists="replace") return self.conn except sqlite3.Error as e: diff --git a/dist/lyzr-0.1.30-py3-none-any.whl b/dist/lyzr-0.1.30-py3-none-any.whl index 070dc50..18ba3e8 100644 Binary files a/dist/lyzr-0.1.30-py3-none-any.whl and b/dist/lyzr-0.1.30-py3-none-any.whl differ diff --git a/dist/lyzr-0.1.30.tar.gz b/dist/lyzr-0.1.30.tar.gz index 096bcbf..16e0234 100644 Binary files a/dist/lyzr-0.1.30.tar.gz and b/dist/lyzr-0.1.30.tar.gz differ