This is the example python code. I want to write that into Glide column. For example, there is a temperature column that user input. Then I want to use that column to create new column with the below conditions.
#Temperature
def news_temperature(score):
if score <= 35.0:
new_score = 3
elif (score >= 35.1 and score <= 36.0) or (score >= 38.1 and score <=39.0):
new_score = 1
elif score >= 36.1 and score <= 38.0:
new_score = 0
elif score >= 39.1:
new_score = 2
return new_score
Your example does work. I just need to put additional condition for when the input value is blank. Thank you very much for your help. So what I would like to understand is that we should write the conditionals starting from the biggest value?
Also may I know if we want to do some kind of machine learning model prediction, can we do that. For example, the input features will be the first 6-8 column features, then we will do some kind of model prediction on the last column. Can we do that?
For example, this kind of case. There will be multiple column structured data, then we will do some kind of model prediction. I saw some tutorial videos of building a chatbot app with OpenAI api but I am not sure if we have multiple input features, can we do model prediction? I haven’t tried that. Thank you very much again for your answer and prompt reply.
I’d say it’s possible, but you’d need to design some rules and craft an appropriate prompt for your AI.
The Glide Blog has quite a few recent articles and tutorials related to using AI in GlideApps. I’d suggest having a browse through there, and you might get some ideas.