Create a function to remove duplicates from an array with Python.
arr = [1,2,2,3,4,4,5]
def remove_duplicates(arr): 
    result = [] 
    seen = set() 
   
    for item in arr: 
        if item not in seen: 
            seen.add(item) 
            result.append(item) 
    return result