Skip to content

Commit 47e64dd

Browse files
0.24.31
Examples fixed
1 parent 83fd6e2 commit 47e64dd

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
77

88
[project]
99
name = "spotpython"
10-
version = "0.24.30"
10+
version = "0.24.31"
1111
authors = [
1212
{ name="T. Bartz-Beielstein", email="tbb@bartzundbartz.de" }
1313
]

src/spotpython/utils/compare.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,13 @@ def check_identical_columns_and_rows(df, remove=False, verbosity=1) -> tuple:
7676
a list of tuples indicating which columns are duplicates,
7777
and a list of tuples indicating which rows are duplicates.
7878
79-
Example:
79+
Examples:
80+
>>> import pandas as pd
81+
>>> from spotpython.utils.compare import check_identical_columns_and_rows
8082
>>> df = pd.DataFrame({"A": [1, 2, 3], "B": [1, 2, 3], "C": [4, 5, 6]})
8183
>>> check_identical_columns_and_rows(df, remove=False, verbosity=1)
82-
Identical columns in DataFrame:
83-
[('A', 'B')]
84+
Identical columns in DataFrame:
85+
[('A', 'B')]
8486
"""
8587
# Check for exact identical columns
8688
identical_columns = []
@@ -130,11 +132,13 @@ def check_identical_columns_and_rows_with_tol(df, tolerance, remove=False, verbo
130132
a list of tuples indicating which columns are duplicates within the tolerance,
131133
and a list of tuples indicating which rows are duplicates within the tolerance.
132134
133-
Example:
135+
Examples:
136+
>>> import pandas as pd
137+
>>> from spotpython.utils.compare import check_identical_columns_and_rows_with_tol
134138
>>> df = pd.DataFrame({"A": [1, 1, 3], "B": [1, 1.01, 3], "C": [4, 5, 6]})
135139
>>> check_identical_columns_and_rows_with_tol(df, tolerance=0.05, remove=False, verbosity=1)
136-
Identical columns within tolerance in DataFrame:
137-
[('A', 'B')]
140+
Identical columns within tolerance in DataFrame:
141+
[('A', 'B')]
138142
"""
139143

140144
# Function to compare rows/columns with tolerance

0 commit comments

Comments
 (0)