def lastTrialsOfLevels(data=None): if not data: users, data = dataProcesada() listOfIndex = [] for levelInstance in data[cts.P_LevelInstance].unique(): listOfIndex += [ data[data[cts.P_LevelInstance] == levelInstance].index[-1] ] data = data.loc[listOfIndex] data = data[[ cts.P_UserId, cts.P_Alias, cts.P_LevelIdentificador, cts.P_FaseActiva, cts.P_OrientacionEntrenamiento, cts.P_NivelEstimuloDinamica, cts.P_LevelInstance, cts.P_SessionInstance ]] return data
def plotByUser (specificData=False, alias=["Todos"], filtroCompletadoActivo=True, expList=cts.expList, onlyOneUser=True, number=-1, join=False, db=None): users, db = dataProcesada(specificData=specificData, alias=alias, filtroCompletadoActivo=filtroCompletadoActivo, expList=expList, onlyOneUser=onlyOneUser, number=number, join=join, db=db) """ excludedSessionInstance = [1473088663797] from scripts.db import pandasTransferencia if not specificData: db = pandasTransferencia() users = db[cts.P_Alias].unique() if alias == ["Todos"] else alias """ for user in users: """ if onlyOneUser: if user != users[number]: continue """ userDb = db[db[cts.P_Alias]==user] """ if filtroCompletadoActivo: userDb = userDb[userDb[cts.P_LevelFinalizado]==True] """ exps = userDb[cts.P_LevelIdentificador].unique() for exp in exps: #display (exp) if exp in expList: data = userDb[userDb[cts.P_LevelIdentificador]==exp] #data = userDb[~userDb[cts.P_SessionInstance].isin(excludedSessionInstance)] plotConvergencia (data, exp, join=join)
def lastTrialsOfLevels(data=None): if not data: users, data = dataProcesada() listOfIndex = [] for levelInstance in data[cts.P_LevelInstance].unique(): listOfIndex += [data[data[cts.P_LevelInstance] == levelInstance].index[-1]] data = data.loc[listOfIndex] data = data[ [ cts.P_UserId, cts.P_Alias, cts.P_LevelIdentificador, cts.P_FaseActiva, cts.P_OrientacionEntrenamiento, cts.P_NivelEstimuloDinamica, cts.P_LevelInstance, cts.P_SessionInstance, ] ] return data