How to pass a literal value to a kedro node? [closed]
2024/11/19 16:46:30
I've got a function
def do_something(input_data, column: int):# Do something with one column of the data
Now I need to create a kedro node, but I can't do node(do_something, ["input_data", 1], "output"). How can I put the constant value (1) into the node?
Answer
One approach would be to pass the data via params. Add column_number: 1 to the parameters.yaml file, and then your node definition would look like node(do_something ["input_data", "params:column_number"], "output").
If you need to reuse the same function in many nodes, changing the column, then it will not work easily. Instead you can use partial, something like node(partial(do_something, column=1), "input_data", "output"])
I need help in looping a list and extracting the src links. This is my list and the code:
getimages = getDetails.find_all(img)
#deleting the first image in the list
getimages[0].decompose()
print(getim…
How can one find the square root of a number without using any pre-defined functions in python?I need the main logic of how a square root of a program works. In general math we will do it using HCF bu…
How do I sort a text file by three columns with a specific order to those columns in Python?My text_file is in the following format with whitespaces between columns:Team_Name Team_Mascot Team_Color Te…
Im trying to find sentences having only one digit number along with.sentence="Im 30 years old."
print(re.match("[0-9]", sentence)then it returns<re.Match object; span=(0, 1), mat…
Closed. This question needs to be more focused. It is not currently accepting answers.Want to improve this question? Update the question so it focuses on one problem only by editing this post.Closed 3…
I am new to all this I have apython app already helo.mysql.py and need to Connect the python app to a database. I am using centos 7 and have it installed on a ec2 instance if anyone can help please he…
I have a list with 155k files. When I random.sample(list, 100), while the results are not the same from the previous sample, they look similar. Is there a better alternative to random.sample that retur…
I have 3 tables (image pasted) all 3 table(have same columns) look same and i want data of address column (yellow colour) of 3 tables stored inside a variable.