Generate python code to rotate an array to the left.
arr = [1, 2, 3, 4, 5]
def rotate_left(arr):
    first_element = arr[0]
    for i in range(len(arr) - 1):
        arr[i] = arr[i + 1]
    arr[len(arr) - 1] = first_element

rotate_left(arr)