User input for python script node

Hello,
I have an ML model in python that takes string input from the users. How do I execute this (user input into python script node)? Adding the section of the code that takes user input -

df = pd.read_excel(“Samplefile.xls”)
val = input("Enter Value: ")
print(val)
if val == ‘All’:
revenue = df
else:
revenue = df.loc[df[‘Section’] == val]

Any help would be appreciated.

Hi,
The correct way, I think, is for you to use a String Configuration or Single Selection Configuration node, connect that to the Python Snippet and use the flow variable there. You can wrap both into a component to have it as one configurable node.
Kind regards
Alexander

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.