gbeflow/__init__.py
def calc_line(points):
    '''
    Given two points calculate the line between the two points
    
    Parameters
    -----------
    points : pd.DataFrame
        Dataframe containing the columns x, y, and 'level_1' (from df.reset_index())
        Each row should contain data for a single point
        
    Returns
    --------
    lines : pd.DataFrame
        Dataframe with columns that specify an equation for a line
    '''
    
    line = pd.DataFrame()
    
    # Specify columns for x1,y1,x2,y2
    line['x1'] = points[points['level_1']==0]['x']
    line['x2'] = points[points['level_1']==1]['x']
    line['y1'] = points[points['level_1']==0]['y']
    line['y2'] = points[points['level_1']==1]['y']
    
    # Calculate the slope
    line['dx'] = line['x2'] - line['x1']
    line['dy'] = line['y2'] - line['y1']
    line['m'] = line['dy']/line['dx']
    
    return(line)

    Given two points calculate the line between the two points
    
    Parameters
    -----------
    points : pd.DataFrame
        Dataframe containing the columns x, y, and 'level_1' (from df.reset_index())
        Each row should contain data for a single point
        
    Returns
    --------
    lines : pd.DataFrame
        Dataframe with columns that specify an equation for a line
    
Given two points calculate the line between the two points
Parameters

points : pd.DataFrame
Dataframe containing the columns x, y, and 'level_1' (from df.reset_index())
Each row should contain data for a single point

Returns

lines : pd.DataFrame
Dataframe with columns that specify an equation for a line
Given two points calculate the line between the two points Parameters points : pd . DataFrame Dataframe containing the columns x y and ' level_1 ' ( from df . reset_index () ) Each row should contain data for a single point Returns lines : pd . DataFrame Dataframe with columns that specify an equation for a line
def calc_line(points):
    line = pd.DataFrame()
    line['x1'] = points[points['level_1']==0]['x']
    line['x2'] = points[points['level_1']==1]['x']
    line['y1'] = points[points['level_1']==0]['y']
    line['y2'] = points[points['level_1']==1]['y']
    line['dx'] = line['x2'] - line['x1']
    line['dy'] = line['y2'] - line['y1']
    line['m'] = line['dy']/line['dx']
    return(line)
def calc_line ( points ) : line = pd . DataFrame ( ) line [ 'x1' ] = points [ points [ 'level_1' ] == 0 ] [ 'x' ] line [ 'x2' ] = points [ points [ 'level_1' ] == 1 ] [ 'x' ] line [ 'y1' ] = points [ points [ 'level_1' ] == 0 ] [ 'y' ] line [ 'y2' ] = points [ points [ 'level_1' ] == 1 ] [ 'y' ] line [ 'dx' ] = line [ 'x2' ] - line [ 'x1' ] line [ 'dy' ] = line [ 'y2' ] - line [ 'y1' ] line [ 'm' ] = line [ 'dy' ] / line [ 'dx' ] return ( line )
Given two points calculate the line between the two points
Parameters
Given two points calculate the line between the two points Parameters
'''
    Given two points calculate the line between the two points
    
    Parameters
    -----------
    points : pd.DataFrame
        Dataframe containing the columns x, y, and 'level_1' (from df.reset_index())
        Each row should contain data for a single point
        
    Returns
    --------
    lines : pd.DataFrame
        Dataframe with columns that specify an equation for a line
    ''' # Specify columns for x1,y1,x2,y2 # Calculate the slope
points