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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rgwfuncs
3
- Version: 0.0.9
3
+ Version: 0.0.10
4
4
  Summary: A functional programming paradigm for mathematical modelling and data science
5
5
  Home-page: https://github.com/ryangerardwilson/rgwfunc
6
6
  Author: Ryan Gerard Wilson
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "rgwfuncs"
7
- version = "0.0.9"
7
+ version = "0.0.10"
8
8
  authors = [
9
9
  { name = "Ryan Gerard Wilson", email = "ryangerardwilson@gmail.com" },
10
10
  ]
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = rgwfuncs
3
- version = 0.0.9
3
+ version = 0.0.10
4
4
  author = Ryan Gerard Wilson
5
5
  author_email = ryangerardwilson@gmail.com
6
6
  description = A functional programming paradigm for mathematical modelling and data science
@@ -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
- result_df = pd.concat([df1, df2], ignore_index=True).drop_duplicates()
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
- result_df = pd.concat([df1, df2], ignore_index=True)
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rgwfuncs
3
- Version: 0.0.9
3
+ Version: 0.0.10
4
4
  Summary: A functional programming paradigm for mathematical modelling and data science
5
5
  Home-page: https://github.com/ryangerardwilson/rgwfunc
6
6
  Author: Ryan Gerard Wilson
File without changes
File without changes