There was an error while loading. Please reload this page.
1 parent 9c96115 commit e5e82a2Copy full SHA for e5e82a2
1 file changed
tests/utils.py
@@ -0,0 +1,26 @@
1
+class DfWrap:
2
+ """
3
+ A wrapper class for a pandas DataFrame that provides custom functionality,
4
+ such as comparing equality with another DataFrame.
5
6
+
7
+ def __init__(self, df):
8
9
+ Initializes the DfWrap instance with a pandas DataFrame.
10
11
+ Parameters:
12
+ df (pd.DataFrame): The DataFrame to wrap.
13
14
+ self.df = df
15
16
+ def __eq__(self, df2):
17
18
+ Checks if the wrapped DataFrame is equal to another DataFrame.
19
20
21
+ df2 (pd.DataFrame): The DataFrame to compare with the wrapped DataFrame.
22
23
+ Returns:
24
+ bool: True if the two DataFrames are equal, False otherwise.
25
26
+ return all(self.df == df2)
0 commit comments