arrays - Python: Merging list elements into one -


i wondering if there methods in python join elements of list 1 element. have like:

test = [(1, 2, 3), (4, 5, 6)] print test[0] (1, 2, 3) print test[1] (4, 5, 6) 

i want this:

test = [(1, 2, 3), (4 ,5, 6)] print test[0] (1, 2, 3), (4, 5, 6) 

i want able transfer contents of test[0] , transfer numpy array such that:

array = [(1, 2, 3), (4, 5, 6), (1, 2, 3), (4, 5, 6), ...] array[0] = (1, 2, 3), (4, 5, 6) array[1] = (1, 2, 3), (4, 5, 6) 

i tried converting string , concatenating, converts everything in list (i.e., brackets , all) chars. suggestions?

edit1: forgot mention using large amount of data. tried using extend(), append() , "+" operator doing run memory issues seems extend, append, , + holds growing list in memory.

edit2: note elements (x, y, z) numpy array structure.

edit3: there confusion. don't want print format (1, 2, 3), (4, 5, 6), need data types in numpy array fashion.

test = [test] 

should trick


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -