Skip to content

Commit f849c59

Browse files
hotfix: data analyzr plotting bars
1 parent ae21f4f commit f849c59

File tree

11 files changed

+39
-30
lines changed

11 files changed

+39
-30
lines changed

build/lib/lyzr/data_analyzr/analyzr.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def _set_logger(self, log_level, print_log):
226226
# Optionally, you can set a formatter for the file handler if you want a different format for file logs
227227
formatter = logging.Formatter(
228228
"%(asctime)s - %(name)s - %(levelname)s\n%(message)s\n",
229-
datefmt="%d-%b-%y %H:%M:%S",
229+
datefmt="%d-%b-%y %H:%M:%S %Z",
230230
)
231231
formatter.converter = time.gmtime
232232
file_handler.setFormatter(formatter)

build/lib/lyzr/data_analyzr/utils.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,13 @@ def remove_punctuation_from_string(value: str) -> str:
4343

4444

4545
def flatten_list(lst: list):
46+
return_lst = []
4647
for el in lst:
4748
if isinstance(el, list):
48-
yield from flatten_list(el)
49+
return_lst.extend(flatten_list(el))
50+
else:
51+
return_lst.append(el)
52+
return return_lst
4953

5054

5155
def _remove_punctuation_from_numeric_string(value) -> str:
@@ -66,11 +70,9 @@ def convert_to_numeric(df: pd.DataFrame, columns: list[str]) -> pd.DataFrame:
6670
for col in columns:
6771
try:
6872
df = df.dropna(subset=[col])
69-
df.loc[:, col] = df.loc[:, col].apply(
70-
_remove_punctuation_from_numeric_string
71-
)
72-
df.loc[:, col] = pd.to_numeric(df.loc[:, col])
73-
df.loc[:, col] = df.loc[:, col].astype("float")
73+
column_values = df.loc[:, col].apply(remove_punctuation_from_string)
74+
column_values = pd.to_numeric(column_values)
75+
df.loc[:, col] = column_values.astype("float")
7476
except Exception:
7577
pass
7678
return df.infer_objects()

dist/lyzr-0.1.36-py3-none-any.whl

-86.5 KB
Binary file not shown.

dist/lyzr-0.1.36.tar.gz

-63.5 KB
Binary file not shown.

dist/lyzr-0.1.37-py3-none-any.whl

85.9 KB
Binary file not shown.

dist/lyzr-0.1.37.tar.gz

62 KB
Binary file not shown.

lyzr.egg-info/PKG-INFO

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
Metadata-Version: 2.1
22
Name: lyzr
3-
Version: 0.1.36
4-
Home-page:
3+
Version: 0.1.37
4+
Summary: UNKNOWN
5+
Home-page: UNKNOWN
56
Author: lyzr
7+
License: UNKNOWN
8+
Platform: UNKNOWN
69
Classifier: Programming Language :: Python :: 3
710
Classifier: License :: OSI Approved :: MIT License
811
Classifier: Operating System :: OS Independent
@@ -162,3 +165,5 @@ response = chatbot.chat("Your question here")
162165
## License
163166

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

lyzr.egg-info/requires.txt

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
asyncio
2-
nest_asyncio
3-
openai==1.3.4
2+
beautifulsoup4==4.12.2
3+
langchain==0.0.339
44
litellm==1.2.0
55
llama-index==0.9.4
6-
langchain==0.0.339
7-
python-dotenv>=1.0.0
8-
beautifulsoup4==4.12.2
9-
pandas==2.0.2
10-
weaviate-client==3.25.3
116
llmsherpa
127
matplotlib==3.8.2
8+
nest_asyncio
9+
openai==1.3.4
10+
pandas==2.0.2
11+
python-dotenv>=1.0.0
12+
weaviate-client==3.25.3
1313

1414
[data-analyzr]
15-
scikit-learn==1.4.0
16-
statsmodels==0.14.1
1715
chromadb==0.4.22
18-
tabulate==0.9.0
19-
pmdarima==2.0.4
20-
openpyxl==3.1.2
21-
redshift_connector==2.0.918
2216
mysql-connector-python==8.2.0
17+
openpyxl==3.1.2
18+
pmdarima==2.0.4
2319
psycopg2-binary==2.9.9
20+
redshift_connector==2.0.918
21+
scikit-learn==1.4.0
2422
snowflake-connector-python==3.6.0
23+
statsmodels==0.14.1
24+
tabulate==0.9.0

lyzr/data_analyzr/analyzr.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def _set_logger(self, log_level, print_log):
226226
# Optionally, you can set a formatter for the file handler if you want a different format for file logs
227227
formatter = logging.Formatter(
228228
"%(asctime)s - %(name)s - %(levelname)s\n%(message)s\n",
229-
datefmt="%d-%b-%y %H:%M:%S",
229+
datefmt="%d-%b-%y %H:%M:%S %Z",
230230
)
231231
formatter.converter = time.gmtime
232232
file_handler.setFormatter(formatter)

lyzr/data_analyzr/utils.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,13 @@ def remove_punctuation_from_string(value: str) -> str:
4343

4444

4545
def flatten_list(lst: list):
46+
return_lst = []
4647
for el in lst:
4748
if isinstance(el, list):
48-
yield from flatten_list(el)
49+
return_lst.extend(flatten_list(el))
50+
else:
51+
return_lst.append(el)
52+
return return_lst
4953

5054

5155
def _remove_punctuation_from_numeric_string(value) -> str:
@@ -66,11 +70,9 @@ def convert_to_numeric(df: pd.DataFrame, columns: list[str]) -> pd.DataFrame:
6670
for col in columns:
6771
try:
6872
df = df.dropna(subset=[col])
69-
df.loc[:, col] = df.loc[:, col].apply(
70-
_remove_punctuation_from_numeric_string
71-
)
72-
df.loc[:, col] = pd.to_numeric(df.loc[:, col])
73-
df.loc[:, col] = df.loc[:, col].astype("float")
73+
column_values = df.loc[:, col].apply(remove_punctuation_from_string)
74+
column_values = pd.to_numeric(column_values)
75+
df.loc[:, col] = column_values.astype("float")
7476
except Exception:
7577
pass
7678
return df.infer_objects()

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="lyzr",
5-
version="0.1.36",
5+
version="0.1.37",
66
author="lyzr",
77
description="",
88
long_description=open("README.md").read(),

0 commit comments

Comments
 (0)