(file_name)
return res
rudimentary method to read in data from a file
rudimentary method to read in data from a file
rudimentary method to read in data from a file
def _fileToMatrix(file_name):
    """rudimentary method to read in data from a file"""
    # TODO: np.loadtxt() might be an alternative
    #     try:
    if 1 < 3:
        lres = []
        for line in open(file_name, 'r').readlines():
            if len(line) > 0 and line[0] not in ('%', '#'):
                lres.append(list(map(float, line.split())))
        res = lres
    else:
        fil = open(file_name, 'r')
        fil.readline() # rudimentary, assume one comment line
        lineToRow = lambda line: list(map(float, line.split()))
        res = list(map(lineToRow, fil.readlines()))
        fil.close()  # close file could be omitted, reference counting should do during garbage collection, but...

    while res != [] and res[0] == []:  # remove further leading empty lines
        del res[0]
    return res
    #     except:
    print('could not read file ' + file_name)
def _fileToMatrix ( file_name ) : # TODO: np.loadtxt() might be an alternative #     try: if 1 < 3 : lres = [ ] for line in open ( file_name , 'r' ) . readlines ( ) : if len ( line ) > 0 and line [ 0 ] not in ( '%' , '#' ) : lres . append ( list ( map ( float , line . split ( ) ) ) ) res = lres else : fil = open ( file_name , 'r' ) fil . readline ( ) # rudimentary, assume one comment line lineToRow = lambda line : list ( map ( float , line . split ( ) ) ) res = list ( map ( lineToRow , fil . readlines ( ) ) ) fil . close ( ) # close file could be omitted, reference counting should do during garbage collection, but... while res != [ ] and res [ 0 ] == [ ] : # remove further leading empty lines del res [ 0 ] return res #     except: print ( 'could not read file ' + file_name )