""" ******************************************************* Owner: Ashutosh Jha For: APPCAIR BITS Pilani Goa Campus, Reflexis Systems Function Name: addCombination This function takes column list, current row and target column as input. It asks the user if they want to use more than one column for a rule, if yes it takes the expression as input and returns a list containing the rule, another list containing features used and a str value indcating expression involving strings. ******************************************************* """ def addCombination(col_list,cur_row,target_col): wantComb = input("Do you want to enter a condition using more than one column?(y or n)") if((wantComb != "y") and (wantComb != "Y")): return None,None,None else: print("This program only supports(+,-,*,/), however make sure no" + " NaN values are present in the column which is divisor.\n" + "If operation involves string, only '+' is supproted," + "all columns must be string type.\n" + "Use brackets to specify equation along with column names.") isstr = input("Is the operation you wish to do deal with string columns only?(y or n)") print("If column list = [col1,col2,col3,col4,col5] then one possible expression for LHS is:") print("((col1+col2)-(col3/col5)*col4), kindly provide all brackets.") print("Enter the LHS expression using Column List given below:") for i in range(0,len(col_list)): if(col_list[i] != target_col): print(col_list[i],"(",type(cur_row[col_list[i]]),")") print("\n") exp = input() exp = [l for m in exp.split(sep='(') for l in (m, '(')][:-1] feature_used =[] i=0 #The following while loops split the expression into brackets, operators and operands #and stores then in a list. while(i