Generate a function in Python that takes in an array and returns an array of the same length with each element multiplied by 2.
[1, 2, 3, 4, 5]
def double_array(arr):
    return [element * 2 for element in arr]