Untitled
unknown
plain_text
a year ago
1.2 kB
8
Indexable
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 dfEditor is loading...
Leave a Comment