input: Write a Python function to generate random walk data.
  assert len(random_walk(10)) == 10
  assert isinstance(random_walk(10), np.ndarray)
  assert random_walk(5).shape == (5,)
output: import numpy as np
  
  def random_walk(n):
      steps = np.random.choice([-1, 1], size=n)
      return np.cumsum(steps)