def readInOBS(path, symbolsArray):

    with open(path, 'rb') as csvfile:
        reader = csv.reader(csvfile, delimiter=',', quotechar='|')
        first_row = next(reader)
        num_cols = len(first_row)
        csvfile.seek(0)
        row_count = sum(1 for row in reader)
        #         print num_cols
        #         print row_count
        csvfile.seek(0)

        data = np.zeros(shape=(row_count, num_cols), dtype=object)
        #         pprint (data)
        i = 0
        for row2 in reader:
            k = 0
            for column in row2:
                #                 print data[i,k]
                #                 t=symbols(str(symbolsArray[k])+str(i))
                #                 s=ooj.obsObject(symbolsArray[k],column)  #create obs object  for each x , y  and z

                data[i, k] = ooj.obsObject(symbolsArray[k], column)
                k = k + 1

            i += 1


#         print data[0][0].value
#         print data[1][1].symbol
        return data
def readInOBS(path,symbolsArray):
    
    with open(path, 'rb') as csvfile:
        reader = csv.reader(csvfile, delimiter=',', quotechar='|')
        first_row = next(reader)
        num_cols = len(first_row)
        csvfile.seek(0)
        row_count = sum(1 for row in reader)
#         print num_cols
#         print row_count
        csvfile.seek(0)
        
        data=np.zeros(shape=(row_count,num_cols),dtype=object)
#         pprint (data)
        i=0
        for row2 in reader:
            k=0
            for column in row2:
#                 print data[i,k]
#                 t=symbols(str(symbolsArray[k])+str(i))
#                 s=ooj.obsObject(symbolsArray[k],column)  #create obs object  for each x , y  and z
                
                data[i,k]=ooj.obsObject(symbolsArray[k],column)
                k=k+1
            

            i+=1
        
#         print data[0][0].value
#         print data[1][1].symbol
        return data
def copyIntoOBSObjectMatrix(Mat, symbolsArray):
    row_count = len(Mat)
    num_cols = len(Mat[0])
    data = np.zeros(shape=(row_count, num_cols), dtype=object)
    #         pprint (data)
    i = 0
    for row2 in Mat:
        k = 0
        for column in row2:
            #                 print data[i,k]
            #                 t=symbols(str(symbolsArray[k])+str(i))
            #                 s=ooj.obsObject(symbolsArray[k],column)  #create obs object  for each x , y  and z

            data[i, k] = ooj.obsObject(symbolsArray[k], column)
            k = k + 1

        i += 1

    return data
def copyIntoOBSObjectMatrix(Mat,symbolsArray):
        row_count=len(Mat)
        num_cols=len(Mat[0])
        data=np.zeros(shape=(row_count,num_cols),dtype=object)
#         pprint (data)
        i=0
        for row2 in Mat:
            k=0
            for column in row2:
#                 print data[i,k]
#                 t=symbols(str(symbolsArray[k])+str(i))
#                 s=ooj.obsObject(symbolsArray[k],column)  #create obs object  for each x , y  and z
                
                data[i,k]=ooj.obsObject(symbolsArray[k],column)
                k=k+1
            

            i+=1
        
        return data