Created
May 20, 2019 10:19
-
-
Save DeastinY/3291758adf1b402b46764d2dbd65b7d2 to your computer and use it in GitHub Desktop.
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
try: | |
df_a = pd.merge(x, y) | |
except pd.errors.MergeError: # occurs if only interventionids are used | |
df_a = None | |
try: | |
df_b = pd.merge(x, y) | |
except pd.errors.MergeError: # occurs if only attributeids are used | |
df_b = None | |
if df_a is None and df_b is None: | |
logging.error("Problems with merging!") | |
elif df_a is None: | |
df = df_b | |
elif df_b is None: | |
df = df_a | |
else: | |
df = pd.concat([df_a, df_b]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment