How to pass a 2D array to a function in Python