Create an optimization problem in Python to optimize the function.
The given function is f(x, y) = x + y^2, where x and y are real numbers.
import numpy as np
from scipy.optimize import minimize
def f(x):
    x, y = x
    return x + y**2

x0 = np.array([0,0])
res = minimize(f, x0, method='nelder-mead')
print(res.x)