def row_count(filename):
    """ Counts the rows in a given file """
    count = 0
    with open(filename, 'r') as ofp:
        for _ in ofp:
            count = count + 1
        # Remove header row from count
        count = count - 1 if count > 0 else count
    return count