Human: Write me a Python function to calculate the memory size of an array. Assistant: 
Here is a Python function to calculate the memory size of an array

import numpy as np

def memory_size(array):
    """
    Return the memory size of an array.
    """
    return array.nbytes

# Enter the matrix
matrix = np.array([[1,2,3],[4,5,6],[7,8,9]])

# Calling the function
print((memory_size(matrix)))

#Example Output
# 72

#Remember to inspect code for bugs.