Last active
September 30, 2017 14:21
-
-
Save bmweiner/1b7b837feb280057918ccd1e83f0898b to your computer and use it in GitHub Desktop.
Compare equality of two pandas dataframes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char | num | mix | extra | |
---|---|---|---|---|
a | 1 | h | 1 | |
b | 2 | i | 1 | |
c | 3 | 3532 | 0 | |
d | 4 | k | 0 | |
e | 5 | 42 | 1 | |
f | 6 | m | 1 | |
g | 7 | n | 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char | num | mix | |
---|---|---|---|
a | 1 | h | |
b | i | ||
a | 3 | 3532 | |
d | 4 | k | |
e | 2 | 42 | |
f | 6 | m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{'columns': [('Columns Match', False), | |
('df1 Columns', | |
array(['char', 'num', 'mix', 'extra'], dtype=object)), | |
('df2 Columns', array(['char', 'num', 'mix'], dtype=object)), | |
('df1 Only', array(['extra'], dtype=object)), | |
('df2 Only', array([], dtype=object))], | |
'setup': [('Filename 1', 'data1.csv'), | |
('Filename 2', 'data2.csv'), | |
('Description', 'Comparison of df1 and df2'), | |
('Absolute Numeric Tolerance', 0.0001), | |
('Relative Numeric Tolerance', 0)], | |
'shapes': [('Shapes Match', False), | |
('df1 Shape', (7, 4)), | |
('df2 Shape', (6, 3))], | |
'values': [('Values Match', False), | |
('Max Shape', (7, 4)), | |
('Possible Values', 28), | |
('Excluded Values', 10), | |
('Shape Compared', (6, 3)), | |
('Total Values Compared', 18), | |
('Total Values Matched', 15), | |
('Total Values Not Matched', 3)]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i | j | col1 | col2 | val1 | val2 | |
---|---|---|---|---|---|---|
1 | 1 | num | num | 2 | ||
4 | 1 | num | num | 5 | 2.0 | |
2 | 0 | char | char | c | a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment