Created
September 15, 2018 15:02
-
-
Save chrisking/a0eb9ba08c14150cfff652b2d75dedd6 to your computer and use it in GitHub Desktop.
XOR test
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
| # First XOR | |
| df2 = df[(df['landing_page'] == "new_page")^(df['group'] == "treatment")] | |
| # Second XOR | |
| df3 = df[(df['landing_page'] == "old_page")^(df['group'] == "control")] | |
| print(pd.merge(df2,df3, indicator=True, how='outer') | |
| .query('_merge=="left_only"') | |
| .drop('_merge', axis=1)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment