data_cleaning.py
def cleaning_same_data(Participants):
    
    """cleaning redundant data: if two data are stored in the same day,
    and scores are the same, keep one; if one score is recorded as missing, then keep the
    other one.


    Parameters
    
    class participant data
    ----------

    Returns
    -------
    
    shortened participant data


    """    
    

    
    Pars=copy.deepcopy(Participants)
    
    n=len(Pars[0].data)
    
    for par in Pars:
        for i in range(n):
            
            t=0
            
            total_len=len(par.time[i])

            
            for j in range(total_len)[:-1]:

                while int(par.time[i][j+1])==int(par.time[i][j]):
                    
                    if par.data[i][j+1]==par.data[i][j]:
                        par.data[i]=np.delete(par.data[i],j+1)
                            
                        par.time[i]=np.delete(par.time[i],j+1)
                        t+=1
                        
                    elif par.data[i][j]<0:


                        
                        par.data[i]=np.delete(par.data[i],j)    
                        par.time[i]=np.delete(par.time[i],j)
                        
                        t+=1
                        
                        
                    else:
                        if par.data[i][j+1]<0:
                            par.data[i]=np.delete(par.data[i],j+1) 
                            par.time[i]=np.delete(par.time[i],j+1) 
                            
                            t+=1
                        else:
                            break
                        
                    if int(j+1+t)==total_len:
                        break
                        

                if int(j+2+t)>=total_len:
                    break
                
    
    return Pars
cleaning redundant data: if two data are stored in the same day,
    and scores are the same, keep one; if one score is recorded as missing, then keep the
    other one.


    Parameters
    
    class participant data
    ----------

    Returns
    -------
    
    shortened participant data


    
cleaning redundant data: if two data are stored in the same day,
and scores are the same, keep one; if one score is recorded as missing, then keep the
other one.

Parameters

class participant data

Returns

shortened participant data
cleaning redundant data : if two data are stored in the same day and scores are the same keep one ; if one score is recorded as missing then keep the other one . Parameters class participant data Returns shortened participant data
def cleaning_same_data(Participants):
    Pars=copy.deepcopy(Participants)
    n=len(Pars[0].data)
    for par in Pars:
        for i in range(n):
            t=0
            total_len=len(par.time[i])
            for j in range(total_len)[:-1]:
                while int(par.time[i][j+1])==int(par.time[i][j]):
                    if par.data[i][j+1]==par.data[i][j]:
                        par.data[i]=np.delete(par.data[i],j+1)
                        par.time[i]=np.delete(par.time[i],j+1)
                        t+=1
                    elif par.data[i][j]<0:
                        par.data[i]=np.delete(par.data[i],j)    
                        par.time[i]=np.delete(par.time[i],j)
                        t+=1
                    else:
                        if par.data[i][j+1]<0:
                            par.data[i]=np.delete(par.data[i],j+1) 
                            par.time[i]=np.delete(par.time[i],j+1) 
                            t+=1
                        else:
                            break
                    if int(j+1+t)==total_len:
                        break
                if int(j+2+t)>=total_len:
                    break
    return Pars
def cleaning_same_data ( Participants ) : Pars = copy . deepcopy ( Participants ) n = len ( Pars [ 0 ] . data ) for par in Pars : for i in range ( n ) : t = 0 total_len = len ( par . time [ i ] ) for j in range ( total_len ) [ : - 1 ] : while int ( par . time [ i ] [ j + 1 ] ) == int ( par . time [ i ] [ j ] ) : if par . data [ i ] [ j + 1 ] == par . data [ i ] [ j ] : par . data [ i ] = np . delete ( par . data [ i ] , j + 1 ) par . time [ i ] = np . delete ( par . time [ i ] , j + 1 ) t += 1 elif par . data [ i ] [ j ] < 0 : par . data [ i ] = np . delete ( par . data [ i ] , j ) par . time [ i ] = np . delete ( par . time [ i ] , j ) t += 1 else : if par . data [ i ] [ j + 1 ] < 0 : par . data [ i ] = np . delete ( par . data [ i ] , j + 1 ) par . time [ i ] = np . delete ( par . time [ i ] , j + 1 ) t += 1 else : break if int ( j + 1 + t ) == total_len : break if int ( j + 2 + t ) >= total_len : break return Pars
cleaning redundant data: if two data are stored in the same day,
and scores are the same, keep one; if one score is recorded as missing, then keep the
other one.
cleaning redundant data : if two data are stored in the same day and scores are the same keep one ; if one score is recorded as missing then keep the other one .
"""cleaning redundant data: if two data are stored in the same day,
    and scores are the same, keep one; if one score is recorded as missing, then keep the
    other one.


    Parameters
    
    class participant data
    ----------

    Returns
    -------
    
    shortened participant data


    """
Participants