Untitled

mail@pastecode.io avatar
unknown
plain_text
4 days ago
1.2 kB
2
Indexable
Never
    def get_immediate_conditional_flow_new(self, input_param_idx, df):
        """
        Function to get immediate code flow. 
        I will the end capturing flow till the immediate IF or EVALUATE
        """
        # seq_list = []
        # print("\n\n\n\nIndexes of Data :",data.index.tolist())
        # if input_param_idx in data.index:
        #     print("INDEX PRESENT")
        #     row      = tuple(data.loc[input_param_idx])
        # else:
        #     print("NO INDEX")
        # seq_list.append(row[0])
        # # While loop to get seq id of flow
        # while (pd.notna(row[5])) and (row[4] not in ['IF', 'EVALUATE']) and (row[5]):
        #     row       = tuple(data[data['Sequence'].astype('int')==int(float(row[5]))].iloc[0])
        #     seq_list.append(row[0])
        # #DF with retrieved seq id 
        # df       = data[data.Sequence.isin(seq_list)]
        #If steatement under ELSE 
        if 'ELSE' in df.Keywords.to_list():
            df = df[~df['Keywords'].str.contains('ELSE')]
            ls = df['Statement'].iloc[0].strip().split()
            ls.insert(1, 'NOT')
            df.iloc[0, 1] = ' '.join(ls)
        return df
Leave a Comment