Created
June 6, 2019 16:51
-
-
Save ravishchawla/b2fcda921d85e07d4c306a525885c059 to your computer and use it in GitHub Desktop.
Starbucks post: Create transactions only dataframes
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
transcript_profile = pd.merge(transcript, profile, left_on='person', right_on='id') | |
# keep only records of actual transactions, and keep integer columns | |
transaction_data_only = transcript_profile[transcript_profile.event_transaction == 1]; | |
transaction_data_only = transaction_data_only.select_dtypes(exclude=['object']); | |
# separate into male and female dataframes | |
transaction_data_f = transaction_data_only[transaction_data_only.gender_F == 1] | |
transaction_data_m = transaction_data_only[transaction_data_only.gender_M == 1] | |
transaction_data_only.head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment