rgwfuncs 0.0.9__py3-none-any.whl → 0.0.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rgwfuncs/df_lib.py +27 -2
- {rgwfuncs-0.0.9.dist-info → rgwfuncs-0.0.11.dist-info}/METADATA +1 -1
- rgwfuncs-0.0.11.dist-info/RECORD +8 -0
- rgwfuncs-0.0.9.dist-info/RECORD +0 -8
- {rgwfuncs-0.0.9.dist-info → rgwfuncs-0.0.11.dist-info}/LICENSE +0 -0
- {rgwfuncs-0.0.9.dist-info → rgwfuncs-0.0.11.dist-info}/WHEEL +0 -0
- {rgwfuncs-0.0.9.dist-info → rgwfuncs-0.0.11.dist-info}/entry_points.txt +0 -0
- {rgwfuncs-0.0.9.dist-info → rgwfuncs-0.0.11.dist-info}/top_level.txt +0 -0
rgwfuncs/df_lib.py
CHANGED
@@ -1631,10 +1631,27 @@ def union_join(df1: pd.DataFrame, df2: pd.DataFrame) -> pd.DataFrame:
|
|
1631
1631
|
if set(df1.columns) != set(df2.columns):
|
1632
1632
|
raise ValueError("Both DataFrames must have the same columns for a union join")
|
1633
1633
|
|
1634
|
-
|
1634
|
+
# Inspect initial columns
|
1635
|
+
print("Initial df1 columns:", df1.columns)
|
1636
|
+
print("Initial df2 columns:", df2.columns)
|
1637
|
+
|
1638
|
+
# Drop all-NA columns, if any
|
1639
|
+
df1_clean = df1.dropna(axis=1, how='all')
|
1640
|
+
df2_clean = df2.dropna(axis=1, how='all')
|
1641
|
+
|
1642
|
+
# Inspect resulting columns after dropping all-NA columns
|
1643
|
+
print("Cleaned df1 columns:", df1_clean.columns)
|
1644
|
+
print("Cleaned df2 columns:", df2_clean.columns)
|
1645
|
+
|
1646
|
+
# Ensure they still have the same columns after dropping all-NA columns
|
1647
|
+
if set(df1_clean.columns) != set(df2_clean.columns):
|
1648
|
+
raise ValueError("Both DataFrames must have the same columns after dropping all-NA columns")
|
1649
|
+
|
1650
|
+
result_df = pd.concat([df1_clean, df2_clean], ignore_index=True).drop_duplicates()
|
1635
1651
|
return result_df
|
1636
1652
|
|
1637
1653
|
|
1654
|
+
|
1638
1655
|
def bag_union_join(df1: pd.DataFrame, df2: pd.DataFrame) -> pd.DataFrame:
|
1639
1656
|
"""
|
1640
1657
|
Perform a bag union join, concatenating the two DataFrames without dropping duplicates.
|
@@ -1652,7 +1669,15 @@ def bag_union_join(df1: pd.DataFrame, df2: pd.DataFrame) -> pd.DataFrame:
|
|
1652
1669
|
if set(df1.columns) != set(df2.columns):
|
1653
1670
|
raise ValueError("Both DataFrames must have the same columns for a bag union join")
|
1654
1671
|
|
1655
|
-
|
1672
|
+
# Drop all-NA columns, if any
|
1673
|
+
df1_clean = df1.dropna(axis=1, how='all')
|
1674
|
+
df2_clean = df2.dropna(axis=1, how='all')
|
1675
|
+
|
1676
|
+
# Ensure they still have the same columns after dropping all-NA columns
|
1677
|
+
if set(df1_clean.columns) != set(df2_clean.columns):
|
1678
|
+
raise ValueError("Both DataFrames must have the same columns after dropping all-NA columns")
|
1679
|
+
|
1680
|
+
result_df = pd.concat([df1_clean, df2_clean], ignore_index=True)
|
1656
1681
|
return result_df
|
1657
1682
|
|
1658
1683
|
|
@@ -0,0 +1,8 @@
|
|
1
|
+
rgwfuncs/__init__.py,sha256=BP8Nh8ivyCCz8Ga-21JW3NWInJFOElKoIfRuioJRWbA,1076
|
2
|
+
rgwfuncs/df_lib.py,sha256=N5XCe9LYMIVjh0pg2Xc1i3Md--mdNJyJ5t7NpO9x4-s,63973
|
3
|
+
rgwfuncs-0.0.11.dist-info/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
|
4
|
+
rgwfuncs-0.0.11.dist-info/METADATA,sha256=mqOIwsthIDAdpgtcFt35vW_xc99f2xtu5O_k4_Y-wQY,32059
|
5
|
+
rgwfuncs-0.0.11.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
6
|
+
rgwfuncs-0.0.11.dist-info/entry_points.txt,sha256=j-c5IOPIQ0252EaOV6j6STio56sbXl2C4ym_fQ0lXx0,43
|
7
|
+
rgwfuncs-0.0.11.dist-info/top_level.txt,sha256=aGuVIzWsKiV1f2gCb6mynx0zx5ma0B1EwPGFKVEMTi4,9
|
8
|
+
rgwfuncs-0.0.11.dist-info/RECORD,,
|
rgwfuncs-0.0.9.dist-info/RECORD
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
rgwfuncs/__init__.py,sha256=BP8Nh8ivyCCz8Ga-21JW3NWInJFOElKoIfRuioJRWbA,1076
|
2
|
-
rgwfuncs/df_lib.py,sha256=3PYfu_zs8HfL56C9Sb41jzoyaG9Oc7x5MZQYvo1zy6M,62930
|
3
|
-
rgwfuncs-0.0.9.dist-info/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
|
4
|
-
rgwfuncs-0.0.9.dist-info/METADATA,sha256=tJiGspLMJbt78FGyyvf3w10ZbWCn17PJ4070wUsH1ew,32058
|
5
|
-
rgwfuncs-0.0.9.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
6
|
-
rgwfuncs-0.0.9.dist-info/entry_points.txt,sha256=j-c5IOPIQ0252EaOV6j6STio56sbXl2C4ym_fQ0lXx0,43
|
7
|
-
rgwfuncs-0.0.9.dist-info/top_level.txt,sha256=aGuVIzWsKiV1f2gCb6mynx0zx5ma0B1EwPGFKVEMTi4,9
|
8
|
-
rgwfuncs-0.0.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|