Created
November 9, 2017 22:09
-
-
Save larssono/47e70be6f5a0e075797bd273576fb4cc 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
import pandas as pd | |
import bridgeclient | |
import synapseclient | |
from multiprocessing.dummy import Pool | |
from synapseutils.monitor import with_progress_bar | |
mp = Pool(4) | |
bridge = bridgeclient.bridgeConnector(<email>, <password>, study='journey-pro') | |
syn = synapseclient.login() | |
startdate = '2017-08-15T00:00:00.000Z' | |
#Get list of participants | |
df = bridge.getParticipants(startdate).drop(['studyIdentifier'], axis=1) | |
getParticipantMeta = with_progress_bar(lambda id: bridge.getParticipantMetaData(id), totalCalls=len(df)) | |
participants = pd.DataFrame(mp.map(getParticipantMeta, df.id)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment