Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def centers_to_edges_1d(x):
- edges = np.empty((x.shape[0] + 1, ))
- edges[1:-1] = (x[:-1] + x[1:]) / 2.
- edges[0] = x[0] - (x[1] - x[0]) / 2.
- edges[-1] = x[-1] - (x[-2] - x[-1]) / 2.
- return edges
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement