Using Column Value in Script #637
Unanswered
kylehSynopsys
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to use TabPy to run a Python script that calls an API Endpoint with a passed in value from each row but am running into issues with the syntax of the arguments.
An overly simplified version of what I am trying to do is the following:
I have a column "ID" in my table that I want to use to create a new column:
ID ----NewColumn
1 ----Row 1
2 ----Row 2
3 ----Row 3
With the below calculation, which is a majorly overly simplified version where my actual script will be running API calls with the value from the row, I get odd results.
The value of the NewColumn ends up being "Row [1, 2, 3]". It appears to be casting the full list of the ID row to a string, so the table would look like:
ID ----NewColumn
1 ----Row [1, 2, 3]
2 ----Row [1, 2, 3]
3 ----Row [1, 2, 3]
However, if I just do this
, the NewColumn gets the corresponding value from the ID row:
ID ----NewColumn
1 ----1
2----2
3----3
I am not able to do NewColumnValue = "Row " + _arg1 because I get and error "TypeError : can only concatenate str (not "list") to str"
How would I go about getting the value of the ID row so I can use that in the script for calculations?
Beta Was this translation helpful? Give feedback.
All reactions