def createXYList(i, lst, yis, y_index):
        # print("list!!", lst)
        # print("List before: ",lst)
        if yis == "Num":
            y_lst = Num()
        else:
            y_lst = Sym()
        x_lst = []
        lst = sorted(lst, key=lambda x: x.cells[y_index])

        for column in range(len(lst[0].cells) -
                            1):  #last column excluded for goal
            if not column == y_index:
                temp = Num()
                for row in lst:
                    temp.add(row.cells[column])
                # print("temp: ", temp)

                x_lst.append(temp)

        for row in lst:
            y_lst.add(row.cells[y_index])

        # print(x_lst)
        return x_lst, y_lst
Esempio n. 2
0
    def createXYList(i, lst, yis):
        lst = sorted(lst, key=lambda x: x[1])
        x_lst = Num()
        if yis == "Num":
            y_lst = Num()
        else:
            y_lst = Sym()
        for i in lst:
            x_lst.add(i[0])
            y_lst.add(i[1])

        return x_lst, y_lst
Esempio n. 3
0
 def numSplit(i, lst):
     newNumber = Num()
     if lst:
         for x in lst:
             newNumber.add(x)
     return newNumber