prepare.py
def fix_tempo(df):
    '''
    From domain knowledge, I know that computer-detected BPMs (beats
    per minute) are often incorrectly assessed as twice its actual value.
    Fact-checked by searching for the official BPM of tracks higher than 160,
    here I have automated fixing tempo by halving any tempo that is 170 or above.
    Doing this increases the accuracy of the tempo values overall.
    '''
    df['tempo'] = np.where(df['tempo'] >= 170, df['tempo']/2, df['tempo'])
    return df

    From domain knowledge, I know that computer-detected BPMs (beats
    per minute) are often incorrectly assessed as twice its actual value.
    Fact-checked by searching for the official BPM of tracks higher than 160,
    here I have automated fixing tempo by halving any tempo that is 170 or above.
    Doing this increases the accuracy of the tempo values overall.
    
From domain knowledge, I know that computer-detected BPMs (beats
per minute) are often incorrectly assessed as twice its actual value.
Fact-checked by searching for the official BPM of tracks higher than 160,
here I have automated fixing tempo by halving any tempo that is 170 or above.
Doing this increases the accuracy of the tempo values overall.
From domain knowledge I know that computer - detected BPMs ( beats per minute ) are often incorrectly assessed as twice its actual value . Fact - checked by searching for the official BPM of tracks higher than 160 here I have automated fixing tempo by halving any tempo that is 170 or above . Doing this increases the accuracy of the tempo values overall .
def fix_tempo(df):
    df['tempo'] = np.where(df['tempo'] >= 170, df['tempo']/2, df['tempo'])
    return df
def fix_tempo ( df ) : df [ 'tempo' ] = np . where ( df [ 'tempo' ] >= 170 , df [ 'tempo' ] / 2 , df [ 'tempo' ] ) return df
From domain knowledge, I know that computer-detected BPMs (beats
per minute) are often incorrectly assessed as twice its actual value.
From domain knowledge I know that computer - detected BPMs ( beats per minute ) are often incorrectly assessed as twice its actual value .
'''
    From domain knowledge, I know that computer-detected BPMs (beats
    per minute) are often incorrectly assessed as twice its actual value.
    Fact-checked by searching for the official BPM of tracks higher than 160,
    here I have automated fixing tempo by halving any tempo that is 170 or above.
    Doing this increases the accuracy of the tempo values overall.
    '''
df