def make_square(arr):
	"""
	Reshape a 1D array (or 2D array with .shape[2]==1) into a square 2D array
	"""
	assert arr.ndim==1 or arr.ndim==2, "array must be 1 or 2-D"
	if arr.ndim==2:
		assert arr.shape[1]==1, "If array is 2d then second dimension must be 1"
		arr = arr.reshape(arr.shape[0])
	assert arr.shape[0]**0.5 == int(arr.shape[0]**0.5), "array shape must be square (it is {})".format(arr.shape[0])
	return arr.reshape(int(arr.shape[0]**0.5), int(arr.shape[0]**0.5))