Skip to content

Commit

Permalink
hotfix: data analyzr plotting bars
Browse files Browse the repository at this point in the history
  • Loading branch information
gargimaheshwari committed Apr 26, 2024
1 parent ae21f4f commit f849c59
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 30 deletions.
2 changes: 1 addition & 1 deletion build/lib/lyzr/data_analyzr/analyzr.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def _set_logger(self, log_level, print_log):
# Optionally, you can set a formatter for the file handler if you want a different format for file logs
formatter = logging.Formatter(
"%(asctime)s - %(name)s - %(levelname)s\n%(message)s\n",
datefmt="%d-%b-%y %H:%M:%S",
datefmt="%d-%b-%y %H:%M:%S %Z",
)
formatter.converter = time.gmtime
file_handler.setFormatter(formatter)
Expand Down
14 changes: 8 additions & 6 deletions build/lib/lyzr/data_analyzr/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ def remove_punctuation_from_string(value: str) -> str:


def flatten_list(lst: list):
return_lst = []
for el in lst:
if isinstance(el, list):
yield from flatten_list(el)
return_lst.extend(flatten_list(el))
else:
return_lst.append(el)
return return_lst


def _remove_punctuation_from_numeric_string(value) -> str:
Expand All @@ -66,11 +70,9 @@ def convert_to_numeric(df: pd.DataFrame, columns: list[str]) -> pd.DataFrame:
for col in columns:
try:
df = df.dropna(subset=[col])
df.loc[:, col] = df.loc[:, col].apply(
_remove_punctuation_from_numeric_string
)
df.loc[:, col] = pd.to_numeric(df.loc[:, col])
df.loc[:, col] = df.loc[:, col].astype("float")
column_values = df.loc[:, col].apply(remove_punctuation_from_string)
column_values = pd.to_numeric(column_values)
df.loc[:, col] = column_values.astype("float")
except Exception:
pass
return df.infer_objects()
Expand Down
Binary file removed dist/lyzr-0.1.36-py3-none-any.whl
Binary file not shown.
Binary file removed dist/lyzr-0.1.36.tar.gz
Binary file not shown.
Binary file added dist/lyzr-0.1.37-py3-none-any.whl
Binary file not shown.
Binary file added dist/lyzr-0.1.37.tar.gz
Binary file not shown.
9 changes: 7 additions & 2 deletions lyzr.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
Metadata-Version: 2.1
Name: lyzr
Version: 0.1.36
Home-page:
Version: 0.1.37
Summary: UNKNOWN
Home-page: UNKNOWN
Author: lyzr
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Expand Down Expand Up @@ -162,3 +165,5 @@ response = chatbot.chat("Your question here")
## License

`lyzr` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.


26 changes: 13 additions & 13 deletions lyzr.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
asyncio
nest_asyncio
openai==1.3.4
beautifulsoup4==4.12.2
langchain==0.0.339
litellm==1.2.0
llama-index==0.9.4
langchain==0.0.339
python-dotenv>=1.0.0
beautifulsoup4==4.12.2
pandas==2.0.2
weaviate-client==3.25.3
llmsherpa
matplotlib==3.8.2
nest_asyncio
openai==1.3.4
pandas==2.0.2
python-dotenv>=1.0.0
weaviate-client==3.25.3

[data-analyzr]
scikit-learn==1.4.0
statsmodels==0.14.1
chromadb==0.4.22
tabulate==0.9.0
pmdarima==2.0.4
openpyxl==3.1.2
redshift_connector==2.0.918
mysql-connector-python==8.2.0
openpyxl==3.1.2
pmdarima==2.0.4
psycopg2-binary==2.9.9
redshift_connector==2.0.918
scikit-learn==1.4.0
snowflake-connector-python==3.6.0
statsmodels==0.14.1
tabulate==0.9.0
2 changes: 1 addition & 1 deletion lyzr/data_analyzr/analyzr.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def _set_logger(self, log_level, print_log):
# Optionally, you can set a formatter for the file handler if you want a different format for file logs
formatter = logging.Formatter(
"%(asctime)s - %(name)s - %(levelname)s\n%(message)s\n",
datefmt="%d-%b-%y %H:%M:%S",
datefmt="%d-%b-%y %H:%M:%S %Z",
)
formatter.converter = time.gmtime
file_handler.setFormatter(formatter)
Expand Down
14 changes: 8 additions & 6 deletions lyzr/data_analyzr/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ def remove_punctuation_from_string(value: str) -> str:


def flatten_list(lst: list):
return_lst = []
for el in lst:
if isinstance(el, list):
yield from flatten_list(el)
return_lst.extend(flatten_list(el))
else:
return_lst.append(el)
return return_lst


def _remove_punctuation_from_numeric_string(value) -> str:
Expand All @@ -66,11 +70,9 @@ def convert_to_numeric(df: pd.DataFrame, columns: list[str]) -> pd.DataFrame:
for col in columns:
try:
df = df.dropna(subset=[col])
df.loc[:, col] = df.loc[:, col].apply(
_remove_punctuation_from_numeric_string
)
df.loc[:, col] = pd.to_numeric(df.loc[:, col])
df.loc[:, col] = df.loc[:, col].astype("float")
column_values = df.loc[:, col].apply(remove_punctuation_from_string)
column_values = pd.to_numeric(column_values)
df.loc[:, col] = column_values.astype("float")
except Exception:
pass
return df.infer_objects()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="lyzr",
version="0.1.36",
version="0.1.37",
author="lyzr",
description="",
long_description=open("README.md").read(),
Expand Down

0 comments on commit f849c59

Please sign in to comment.