rgwfuncs 0.0.61__py3-none-any.whl → 0.0.63__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- rgwfuncs/df_lib.py +6 -16
- {rgwfuncs-0.0.61.dist-info → rgwfuncs-0.0.63.dist-info}/METADATA +1 -1
- {rgwfuncs-0.0.61.dist-info → rgwfuncs-0.0.63.dist-info}/RECORD +7 -7
- {rgwfuncs-0.0.61.dist-info → rgwfuncs-0.0.63.dist-info}/LICENSE +0 -0
- {rgwfuncs-0.0.61.dist-info → rgwfuncs-0.0.63.dist-info}/WHEEL +0 -0
- {rgwfuncs-0.0.61.dist-info → rgwfuncs-0.0.63.dist-info}/entry_points.txt +0 -0
- {rgwfuncs-0.0.61.dist-info → rgwfuncs-0.0.63.dist-info}/top_level.txt +0 -0
rgwfuncs/df_lib.py
CHANGED
@@ -503,8 +503,7 @@ def load_data_from_path(file_path: str) -> pd.DataFrame:
|
|
503
503
|
df = pd.read_hdf(file_path, key=key)
|
504
504
|
break
|
505
505
|
else:
|
506
|
-
print(
|
507
|
-
f"Key '{key}' is not in the available keys.")
|
506
|
+
print(f"Key '{key}' is not in the available keys.")
|
508
507
|
return df
|
509
508
|
|
510
509
|
# Ensure the file path is absolute
|
@@ -826,8 +825,7 @@ def print_dataframe(df: pd.DataFrame, source: Optional[str] = None) -> None:
|
|
826
825
|
"""
|
827
826
|
if df is not None:
|
828
827
|
print(df)
|
829
|
-
columns_with_types = [
|
830
|
-
f"{col} ({df[col].dtypes})" for col in df.columns]
|
828
|
+
columns_with_types = [f"{col} ({df[col].dtypes})" for col in df.columns]
|
831
829
|
print("Columns:", columns_with_types)
|
832
830
|
if source:
|
833
831
|
print(f"Source: {source}")
|
@@ -1269,10 +1267,8 @@ def append_percentile_classification_column(
|
|
1269
1267
|
|
1270
1268
|
if has_decimals:
|
1271
1269
|
percentiles_list = [float(p) for p in percentiles_list]
|
1272
|
-
max_decimal_length = max(
|
1273
|
-
|
1274
|
-
max_integer_length = max(len(str(int(float(p))))
|
1275
|
-
for p in percentiles_list)
|
1270
|
+
max_decimal_length = max(len(str(p).split('.')[1]) for p in percentiles_list if '.' in str(p))
|
1271
|
+
max_integer_length = max(len(str(int(float(p)))) for p in percentiles_list)
|
1276
1272
|
|
1277
1273
|
labels = []
|
1278
1274
|
|
@@ -1639,9 +1635,7 @@ def print_n_frequency_cascading(
|
|
1639
1635
|
if len(columns) > 1:
|
1640
1636
|
sub_report = generate_cascade_report(
|
1641
1637
|
filtered_df, columns[1:], limit, order_by)
|
1642
|
-
report[value] = {
|
1643
|
-
"count": str(count), f"sub_distribution({
|
1644
|
-
columns[1]})": sub_report if sub_report else {}}
|
1638
|
+
report[value] = {"count": str(count), f"sub_distribution({columns[1]})": sub_report if sub_report else {}}
|
1645
1639
|
else:
|
1646
1640
|
report[value] = {"count": str(count)}
|
1647
1641
|
|
@@ -1953,11 +1947,7 @@ def insert_dataframe_in_sqlite_database(
|
|
1953
1947
|
|
1954
1948
|
if not table_exists(cursor, tablename):
|
1955
1949
|
columns_with_types = ', '.join(
|
1956
|
-
f'"{col}" {
|
1957
|
-
map_dtype(dtype)}' for col,
|
1958
|
-
dtype in zip(
|
1959
|
-
df.columns,
|
1960
|
-
df.dtypes))
|
1950
|
+
f'"{col}" {map_dtype(dtype)}' for col, dtype in zip(df.columns, df.dtypes))
|
1961
1951
|
create_table_query = f'CREATE TABLE "{tablename}" ({columns_with_types})'
|
1962
1952
|
conn.execute(create_table_query)
|
1963
1953
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
rgwfuncs/__init__.py,sha256=-rcdj4_9zq82h0Tl00S9GvEqDYh7yhPCNhnhBs3mZCg,1676
|
2
2
|
rgwfuncs/algebra_lib.py,sha256=rKFITfpWfgdBswnbMUuS41XgndEt-jUVz2ObO_ik7eM,42234
|
3
|
-
rgwfuncs/df_lib.py,sha256=
|
3
|
+
rgwfuncs/df_lib.py,sha256=eGEMVv-vRRtH-tGDpBK6M73QOLz5GIGcqUl8UuNyFw8,68158
|
4
4
|
rgwfuncs/docs_lib.py,sha256=y3wSAOPO3qsA4HZ7xAtW8HimM8w-c8hjcEzMRLJ96ao,1960
|
5
5
|
rgwfuncs/interactive_shell_lib.py,sha256=A7EWsYxAfDev_N0-2GjRvAtp0bAwBPHIczXb8Gu9fzI,1107
|
6
6
|
rgwfuncs/str_lib.py,sha256=rtAdRlnSJIu3JhI-tA_A0wCiPK2m-zn5RoGpBxv_g-4,2228
|
7
|
-
rgwfuncs-0.0.
|
8
|
-
rgwfuncs-0.0.
|
9
|
-
rgwfuncs-0.0.
|
10
|
-
rgwfuncs-0.0.
|
11
|
-
rgwfuncs-0.0.
|
12
|
-
rgwfuncs-0.0.
|
7
|
+
rgwfuncs-0.0.63.dist-info/LICENSE,sha256=jLvt20gcUZYB8UOvyBvyKQ1qhYYhD__qP7ZDx2lPFkU,1062
|
8
|
+
rgwfuncs-0.0.63.dist-info/METADATA,sha256=Cb9W5hAQLMD8nTRWNZ1GCOSesld1R1Bo4BIw0RHjlek,58951
|
9
|
+
rgwfuncs-0.0.63.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
10
|
+
rgwfuncs-0.0.63.dist-info/entry_points.txt,sha256=j-c5IOPIQ0252EaOV6j6STio56sbXl2C4ym_fQ0lXx0,43
|
11
|
+
rgwfuncs-0.0.63.dist-info/top_level.txt,sha256=aGuVIzWsKiV1f2gCb6mynx0zx5ma0B1EwPGFKVEMTi4,9
|
12
|
+
rgwfuncs-0.0.63.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|