kalebswartz7/excercise_01/parse.py
def populate_matrix(matrix, horizontal, vertical):
    """
    Reads in all non-commented data from file, parses into 2D array based on Horizontal and Vertical Points 

    Parameters
    ----------
    matrix : 2D array 
        array that will be populated by the data parsed in the input file
    horizontal : int 
        # of horizontal rows in matrix
    vertical : int
        # of vertical rows in matrix
    
    Notes
    -----
    
    """
    matrix = [[0 for i in range(horizontal)] for j in range(vertical)] 
    with open('res_int_pr_se.dat') as file:
        h, v = 0, 0
        for line in file:
            if '#' not in line:
                matrix[v][h] = float(line)
                if (h < horizontal - 1):
                    h += 1
                else:
                    h = 0
                    v += 1
    return matrix

    Reads in all non-commented data from file, parses into 2D array based on Horizontal and Vertical Points 

    Parameters
    ----------
    matrix : 2D array 
        array that will be populated by the data parsed in the input file
    horizontal : int 
        # of horizontal rows in matrix
    vertical : int
        # of vertical rows in matrix
    
    Notes
    -----
    
    
Reads in all non-commented data from file, parses into 2D array based on Horizontal and Vertical Points
Parameters

matrix : 2D array
array that will be populated by the data parsed in the input file
horizontal : int
of horizontal rows in matrix
vertical : int
of vertical rows in matrix

Notes
Reads in all non - commented data from file parses into 2D array based on Horizontal and Vertical Points Parameters matrix : 2D array array that will be populated by the data parsed in the input file horizontal : int of horizontal rows in matrix vertical : int of vertical rows in matrix Notes
def populate_matrix(matrix, horizontal, vertical):
    matrix = [[0 for i in range(horizontal)] for j in range(vertical)] 
    with open('res_int_pr_se.dat') as file:
        h, v = 0, 0
        for line in file:
            if '#' not in line:
                matrix[v][h] = float(line)
                if (h < horizontal - 1):
                    h += 1
                else:
                    h = 0
                    v += 1
    return matrix
def populate_matrix ( matrix , horizontal , vertical ) : matrix = [ [ 0 for i in range ( horizontal ) ] for j in range ( vertical ) ] with open ( 'res_int_pr_se.dat' ) as file : h , v = 0 , 0 for line in file : if '#' not in line : matrix [ v ] [ h ] = float ( line ) if ( h < horizontal - 1 ) : h += 1 else : h = 0 v += 1 return matrix
Reads in all non-commented data from file, parses into 2D array based on Horizontal and Vertical Points
Parameters
Reads in all non - commented data from file parses into 2D array based on Horizontal and Vertical Points Parameters
"""
    Reads in all non-commented data from file, parses into 2D array based on Horizontal and Vertical Points 

    Parameters
    ----------
    matrix : 2D array 
        array that will be populated by the data parsed in the input file
    horizontal : int 
        # of horizontal rows in matrix
    vertical : int
        # of vertical rows in matrix
    
    Notes
    -----
    
    """
matrix
horizontal
vertical