Last active
May 9, 2021 08:02
-
-
Save UweZiegenhagen/1d7c4fe09e289bc1afb3ef8f7c199a35 to your computer and use it in GitHub Desktop.
Medium-20210509-2.py
This file contains hidden or 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
| # load both files into separate dataframes | |
| file1 = pd.read_csv('file1.csv', sep=';', encoding='UTF-8') | |
| file2 = pd.read_csv('file2.csv', sep=';', encoding='UTF-8') | |
| # save the list of column names for each dataset | |
| columnnames1 = list(file1) | |
| columnnames2 = list(file2) | |
| # check if the columns match | |
| if collections.Counter(columnnames1) == collections.Counter(columnnames2): | |
| print ("Number of columns and Names match, Comparison possible...\n\n") | |
| else: | |
| print ("Number of columns and Names are not matching!!! Please check the input!") | |
| sys.exit('Error!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment