Skip to content

Commit eeffb0e

Browse files
authored
Pandas PerformanceWarning fix (#395)
1 parent 937dc72 commit eeffb0e

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

datacompy/core.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -359,13 +359,19 @@ def _intersect_compare(self, ignore_spaces: bool, ignore_case: bool) -> None:
359359
col_1 = column + "_" + self.df1_name
360360
col_2 = column + "_" + self.df2_name
361361
col_match = column + "_match"
362-
self.intersect_rows[col_match] = columns_equal(
363-
self.intersect_rows[col_1],
364-
self.intersect_rows[col_2],
365-
self.rel_tol,
366-
self.abs_tol,
367-
ignore_spaces,
368-
ignore_case,
362+
self.intersect_rows = pd.concat(
363+
[
364+
self.intersect_rows,
365+
columns_equal(
366+
self.intersect_rows[col_1],
367+
self.intersect_rows[col_2],
368+
self.rel_tol,
369+
self.abs_tol,
370+
ignore_spaces,
371+
ignore_case,
372+
).to_frame(name=col_match),
373+
],
374+
axis=1,
369375
)
370376
match_cnt = self.intersect_rows[col_match].sum()
371377
max_diff = calculate_max_diff(

0 commit comments

Comments
 (0)