human
Write me a Python code to convert bin edges to bin centres.
assistant
Here is a Python code to convert bin edges to bin centres

import numpy as np

def _BinEdgesToCentres(bin_edges):
  """Converts bin edges to bin centres."""
  bin_centres = []
  for i in range(len(bin_edges) - 1):
    bin_centres.append((bin_edges[i] + bin_edges[i + 1]) / 2)
  return bin_centres

# Enter the bin edges
bin_edges = np.arange(0, 10, 1)

# Calling the function
bin_centres = _BinEdgesToCentres(bin_edges)

# Printing the bin centres
print(bin_centres)

#Example Output
# [0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5]

#Remember to inspect code for bugs.