0

I want to concatenate two tuples in DolphinDB in the way similar to concatenating vectors.

For example, I have two tuples:

a=(1,2,3)

and

b=(4,5,6)

and I attempted to use

join

to obtain

re=(1,2,3,4,5,6)

However, the output is (1,2,3,(4,5,6)),which is same as the result of

 a.append!(b)

How could I modify my script?

1 Answer 1

0

The join will treat b as a single item and that's why the result is a nested tuple. You have to convert a and b to vectors, join them and then convert back to tuple.

a = (1,2,3) b = (4,5,6) 
re = tuple(join(vector(a), vector(b)))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.