Human: how to solve a matrix by using numpy. Assistant: 
Here is a Python function to solve a matrix by using numpy

import numpy as np

def solve_matrix(matrix, b):
  """Solve a matrix by using numpy."""
  return np.linalg.solve(matrix, b)

# Create a matrix
matrix = np.array([[1, 2], [3, 4]])

# Create a vector
b = np.array([1, 2])

# Calling the function
print((solve_matrix(matrix, b)))

#Example Output
# [0.  0.5]

#Remember to inspect code for bugs.