Skip to content

Commit

Permalink
rebuild with changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gargimaheshwari committed Apr 4, 2024
1 parent aee2bc4 commit d89cc86
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build/lib/lyzr/base/prompts/analysis_steps_pt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 5 additions & 4 deletions build/lib/lyzr/data_analyzr/analyzr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 8 additions & 0 deletions build/lib/lyzr/data_analyzr/db_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Binary file modified dist/lyzr-0.1.30-py3-none-any.whl
Binary file not shown.
Binary file modified dist/lyzr-0.1.30.tar.gz
Binary file not shown.

0 comments on commit d89cc86

Please sign in to comment.