In the context of setting a numpy array element with a sequence, you can use the built-in connection to bypass setting it to a string:
str_list_obj = '-'.join(list_obj)
and then, when necessary, split the string sequence again using the same connector (if it does not appear in the list lines):
og_list_obj = str_list_obj.split("-")
source share