Create a Python function to remove duplicate elements from a given array.
array = [1, 2, 5, 2, 1, 9]
def remove_duplicates(array): 
    result = set() 
    for element in array: 
        result.add(element) 
  
    return list(result) 
  
result = remove_duplicates(array) 
print(result)