I am working with databricks dataframe(pyspark)
I have a dataframe that contains a array with string value.
I need to use the df value to assemble with value from a python array that i have.
What i want is to put the df value in a python array like this:
listArray = []
listArray.append(dataframeArrayValue)
print(listArray)
outPut:
[value1, value2, value3]
The problem I get is that it kind off work, but for some reason I can not work with the string value that is added to the new array list(listArray).
My concept is that i am gonna build a url, where i need to use SQL to get the begining information of that url. That first part is what i put in the df array. For the last part off the url, i have that stored in a python array.
I want to loop through both array, and put the result in a empty array.
Something like this:
display(dfList)
outPut:
[dfValue1, dafValue2, dfValue3]
print(pyList)
[pyValue1, pyValue2, pyValue3]
Whant to put them together like this:
dfValue1 + pyValue2 etc..
And getting a array like this:
newArrayContainingBoth = []
-- loop with append
result:
print(newArrayContainingBoth)
outPut:
[dfValue1+pyValue1, dfValue2+pyValue2, dfValue3+pyValue]
Hope my question was clear enough
newArrayContainingBoth = dfList + pyList