Created
May 28, 2016 21:46
-
-
Save cpard/e7cbcf55ab8fce99360fbf7fef292037 to your computer and use it in GitHub Desktop.
Import Mailchimp Data with Python & Pandas
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
from sqlalchemy import create_engine | |
import pandas as padas | |
engine = create_engine('postgresql://USERNAME:PASSWORD@HOST:PORT/DATABASE) | |
joinedQuery = "select mailchimp_report_email_activity.email_address as email, merge_fields_lname as last_name, merge_fields_fname as first_name, action, timestamp from mailchimp_report_email_activity left join mailchimp_list_members on mailchimp_report_email_activity.email_address = mailchimp_list_members.email_address;" | |
joinedEventsFrame = padas.read_sql_query(joinedQuery, engine) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment