computes the axis x and y of a given 2d grid
    :param x:
    :param y:
    :return:
19461
def get_axes(x, y):
    
    n=int(np.sqrt(len(x)))
    if n**2 != len(x):
        raise ValueError("lenght of input array given as %s is not square of integer number!" % (len(x)))
    x_image = x.reshape(n,n)
    y_image = y.reshape(n,n)
    x_axes = x_image[0,:]
    y_axes = y_image[:,0]
    return x_axes, y_axes
85120
def y0(x, context=None):
    
    return _apply_function_in_current_context(
        BigFloat,
        mpfr.mpfr_y0,
        (BigFloat._implicit_convert(x),),
        context,
    )
424421
def _get_y_axis(self):
        """"""
        # 0,0 is top/left top top/left pixel. Actual x/y coord of that pixel are (.5,.5).
        y_centers = np.linspace(.5, self.y_size - .5, self.y_size)
        x_centers = y_centers * 0
        return (self.geotransform[3]
                + self.geotransform[4] * x_centers
                + self.geotransform[5] * y_centers)
1178209
def RadiusGrid(gridSize):
    
    x,y=np.mgrid[0:gridSize,0:gridSize]
    x = x-(gridSize-1.0)/2.0
    y = y-(gridSize-1.0)/2.0
    return np.abs(x+1j*y)
896234
def axis_to_data(ax, width):
    
    xlim = ax.get_xlim()
    widthx = width*(xlim[1] - xlim[0])
    ylim = ax.get_ylim()
    widthy = width*(ylim[1] - ylim[0])
    return 0.5*(widthx + widthy)
972122
def infer_x(self, y):
        
        assert len(y) == self.fmodel.dim_y, "Wrong dimension for y. Expected %i, got %i" % (self.fmodel.dim_y, len(y))
        self.goal = np.array(y)
989122
def G(w, Xs):
    ''''''
    n = len(Xs)
    P = projection_matrix(w)
    Ys = [np.dot(P, X) for X in Xs]
    A = calc_A(Ys)
    A_hat = calc_A_hat(A, skew_matrix(w))

    
    u = sum(np.dot(Y, Y) for Y in Ys) / n
    v = np.dot(A_hat, sum(np.dot(Y, Y) * Y for Y in Ys)) / np.trace(np.dot(A_hat, A))

    return sum((np.dot(Y, Y) - u - 2 * np.dot(Y, v)) ** 2 for Y in Ys)
522831
def unpack2D(_x):
    
    _x = np.atleast_2d(_x)
    x = _x[:, 0]
    y = _x[:, 1]
    return x, y
918935
def fit(self, x, y, **kwargs):
        
        self.mean = numpy.mean(y)
        return {}
1371202
def _get_plane_axes(self, axis):
        
        return [self._get_axis(axi)
                for axi in self._get_plane_axes_index(axis)]
900491
def axis(self) -> Callable[[Any], Any]:
        
        axis_func = hist_axis_func(
            axis_type = self.axis_type
        )
        return axis_func
128721
def get_xyz_tri(self, xcoord, x, ycoord, y, u, v):
        """"""
        return self.get_xyz_2d(xcoord, x, ycoord, y, u, v)
1136968
def compute_y(self, coefficients, num_x):
        
        y_vals = []

        for x in range(1, num_x + 1):
            y = sum([c * x ** i for i, c in enumerate(coefficients[::-1])])
            y_vals.append(y)

        return y_vals
1327101
def fit(self, X, y):
        
        self.X = X
        self.y = y
597556
def plot(self):
		'''
		
		'''
		pl.plot(self.x, self.y, '.')
		pl.plot(self.x_int, self.y_int)
		pl.grid(True)
		pl.show()
1291164
def transform_point(self, x, y):
        
        xy = ffi.new('double[2]', [x, y])
        cairo.cairo_matrix_transform_point(self._pointer, xy + 0, xy + 1)
        return tuple(xy)
739587
def euclidean(x, y):
    
    result = 0.0
    for i in range(x.shape[0]):
        result += (x[i] - y[i]) ** 2
    return np.sqrt(result)