rgwfuncs 0.0.9__tar.gz → 0.0.10__tar.gz
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-0.0.9/src/rgwfuncs.egg-info → rgwfuncs-0.0.10}/PKG-INFO +1 -1
- {rgwfuncs-0.0.9 → rgwfuncs-0.0.10}/pyproject.toml +1 -1
- {rgwfuncs-0.0.9 → rgwfuncs-0.0.10}/setup.cfg +1 -1
- {rgwfuncs-0.0.9 → rgwfuncs-0.0.10}/src/rgwfuncs/df_lib.py +18 -2
- {rgwfuncs-0.0.9 → rgwfuncs-0.0.10/src/rgwfuncs.egg-info}/PKG-INFO +1 -1
- {rgwfuncs-0.0.9 → rgwfuncs-0.0.10}/LICENSE +0 -0
- {rgwfuncs-0.0.9 → rgwfuncs-0.0.10}/README.md +0 -0
- {rgwfuncs-0.0.9 → rgwfuncs-0.0.10}/src/rgwfuncs/__init__.py +0 -0
- {rgwfuncs-0.0.9 → rgwfuncs-0.0.10}/src/rgwfuncs.egg-info/SOURCES.txt +0 -0
- {rgwfuncs-0.0.9 → rgwfuncs-0.0.10}/src/rgwfuncs.egg-info/dependency_links.txt +0 -0
- {rgwfuncs-0.0.9 → rgwfuncs-0.0.10}/src/rgwfuncs.egg-info/entry_points.txt +0 -0
- {rgwfuncs-0.0.9 → rgwfuncs-0.0.10}/src/rgwfuncs.egg-info/requires.txt +0 -0
- {rgwfuncs-0.0.9 → rgwfuncs-0.0.10}/src/rgwfuncs.egg-info/top_level.txt +0 -0
@@ -1631,7 +1631,15 @@ 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
|
+
# Drop all-NA columns, if any
|
1635
|
+
df1_clean = df1.dropna(axis=1, how='all')
|
1636
|
+
df2_clean = df2.dropna(axis=1, how='all')
|
1637
|
+
|
1638
|
+
# Ensure they still have the same columns after dropping all-NA columns
|
1639
|
+
if set(df1_clean.columns) != set(df2_clean.columns):
|
1640
|
+
raise ValueError("Both DataFrames must have the same columns after dropping all-NA columns")
|
1641
|
+
|
1642
|
+
result_df = pd.concat([df1_clean, df2_clean], ignore_index=True).drop_duplicates()
|
1635
1643
|
return result_df
|
1636
1644
|
|
1637
1645
|
|
@@ -1652,7 +1660,15 @@ def bag_union_join(df1: pd.DataFrame, df2: pd.DataFrame) -> pd.DataFrame:
|
|
1652
1660
|
if set(df1.columns) != set(df2.columns):
|
1653
1661
|
raise ValueError("Both DataFrames must have the same columns for a bag union join")
|
1654
1662
|
|
1655
|
-
|
1663
|
+
# Drop all-NA columns, if any
|
1664
|
+
df1_clean = df1.dropna(axis=1, how='all')
|
1665
|
+
df2_clean = df2.dropna(axis=1, how='all')
|
1666
|
+
|
1667
|
+
# Ensure they still have the same columns after dropping all-NA columns
|
1668
|
+
if set(df1_clean.columns) != set(df2_clean.columns):
|
1669
|
+
raise ValueError("Both DataFrames must have the same columns after dropping all-NA columns")
|
1670
|
+
|
1671
|
+
result_df = pd.concat([df1_clean, df2_clean], ignore_index=True)
|
1656
1672
|
return result_df
|
1657
1673
|
|
1658
1674
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|