rgwfuncs 0.0.12__tar.gz → 0.0.13__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.12
3
+ Version: 0.0.13
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.12"
7
+ version = "0.0.13"
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.12
3
+ version = 0.0.13
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
@@ -61,6 +61,7 @@ def docs(method_type_filter: Optional[str] = None) -> None:
61
61
  # Print the entire docstring for the matching function
62
62
  print(f"\n{name}:\n{docstring}")
63
63
 
64
+
64
65
  def numeric_clean(df: pd.DataFrame, column_names: str, column_type: str, irregular_value_treatment: str) -> pd.DataFrame:
65
66
  """
66
67
  Cleans the numeric columns based on specified treatments.
@@ -1629,8 +1630,8 @@ def union_join(df1: pd.DataFrame, df2: pd.DataFrame) -> pd.DataFrame:
1629
1630
  ValueError: If the DataFrames do not have the same columns.
1630
1631
  """
1631
1632
  # Inspect initial columns
1632
- print("Initial df1 columns:", df1.columns)
1633
- print("Initial df2 columns:", df2.columns)
1633
+ # print("Initial df1 columns:", df1.columns)
1634
+ # print("Initial df2 columns:", df2.columns)
1634
1635
 
1635
1636
  # Standardize columns by adding missing columns filled with NaN
1636
1637
  for col in df2.columns:
@@ -1641,8 +1642,8 @@ def union_join(df1: pd.DataFrame, df2: pd.DataFrame) -> pd.DataFrame:
1641
1642
  if col not in df2:
1642
1643
  df2[col] = pd.NA
1643
1644
 
1644
- print("Standardized df1 columns:", df1.columns)
1645
- print("Standardized df2 columns:", df2.columns)
1645
+ # print("Standardized df1 columns:", df1.columns)
1646
+ # print("Standardized df2 columns:", df2.columns)
1646
1647
 
1647
1648
  # Check if columns match now
1648
1649
  if set(df1.columns) != set(df2.columns):
@@ -1652,6 +1653,7 @@ def union_join(df1: pd.DataFrame, df2: pd.DataFrame) -> pd.DataFrame:
1652
1653
  result_df = pd.concat([df1, df2], ignore_index=True).drop_duplicates()
1653
1654
  return result_df
1654
1655
 
1656
+
1655
1657
  def bag_union_join(df1: pd.DataFrame, df2: pd.DataFrame) -> pd.DataFrame:
1656
1658
  """
1657
1659
  Perform a bag union join, concatenating the two DataFrames without dropping duplicates.
@@ -1667,8 +1669,8 @@ def bag_union_join(df1: pd.DataFrame, df2: pd.DataFrame) -> pd.DataFrame:
1667
1669
  ValueError: If the DataFrames do not have the same columns.
1668
1670
  """
1669
1671
  # Inspect initial columns
1670
- print("Initial df1 columns:", df1.columns)
1671
- print("Initial df2 columns:", df2.columns)
1672
+ # print("Initial df1 columns:", df1.columns)
1673
+ # print("Initial df2 columns:", df2.columns)
1672
1674
 
1673
1675
  # Standardize columns by adding missing columns filled with NaN
1674
1676
  for col in df2.columns:
@@ -1679,8 +1681,8 @@ def bag_union_join(df1: pd.DataFrame, df2: pd.DataFrame) -> pd.DataFrame:
1679
1681
  if col not in df2:
1680
1682
  df2[col] = pd.NA
1681
1683
 
1682
- print("Standardized df1 columns:", df1.columns)
1683
- print("Standardized df2 columns:", df2.columns)
1684
+ # print("Standardized df1 columns:", df1.columns)
1685
+ # print("Standardized df2 columns:", df2.columns)
1684
1686
 
1685
1687
  # Ensure they have the same columns after standardizing
1686
1688
  if set(df1.columns) != set(df2.columns):
@@ -1722,6 +1724,7 @@ def right_join(df1: pd.DataFrame, df2: pd.DataFrame, left_on: str, right_on: str
1722
1724
  """
1723
1725
  return df1.merge(df2, how='right', left_on=left_on, right_on=right_on)
1724
1726
 
1727
+
1725
1728
  def sync_dataframe_to_sqlite_database(db_path: str, tablename: str, df: pd.DataFrame) -> None:
1726
1729
  """
1727
1730
  Processes and saves a DataFrame to an SQLite database, adding a timestamp column
@@ -1776,5 +1779,3 @@ def sync_dataframe_to_sqlite_database(db_path: str, tablename: str, df: pd.DataF
1776
1779
  conn.execute(f"DROP TABLE IF EXISTS {tablename}")
1777
1780
  # Rename the new table to the old table name
1778
1781
  conn.execute(f"ALTER TABLE {new_table_name} RENAME TO {tablename}")
1779
-
1780
-
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rgwfuncs
3
- Version: 0.0.12
3
+ Version: 0.0.13
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