def end_phase_previous_exon(data_frame,
                            exon_pos,
                            prev_row_index,
                            end_phase_column='EndPhase'):
    """
    Return the end phase of the previous exon.

    It returns 0 if the actual exon is the first in the transcript.
    """
    if exon_pos == 0:
        return 0

    return data_frame.loc[prev_row_index, end_phase_column]