Write a Python code that takes in data points in time-series and returns the average of the data points for the given period.
[1, 3, 4, 5, 3, 9, 6]
def average_of_period(arr):
    return sum(arr) / len(arr)

result = average_of_period([1, 3, 4, 5, 3, 9, 6])
print(result)