Hi,
I have a list of sublists where I would like to combine these sub
lists into one list.
Here is my code where I created this list of sublists.
p = list(str(n(pi, digits = 2000000)))
p.remove('.')
p1 = [int(x) for x in p]
l1 = [0,1,0,6,2,0,1,2,0,9,1,7,2,8,3,4,4,8,4,6]
l31 = [[x for x,y in zip(l1,p1[i:i+20]) if x==y] for i in
range(200000)]
l41 = [[c for c, (ai,bi) in enumerate(zip(l1,p1[i:i+20])) if ai == bi]
for i in range(200000)]
results:
[[1],[2,8,4,6],[1,2,7],[9,3,4,6],...]
[[1],[14,17,18,19],[1,4,11],[9,14,16,19],...]
would like to figure out how to get both results like this:
[1,2,8,4,6,1,2,7,9,3,4,6,...]
[1,14,17,18,19,1,4,11,9,14,16,19...]
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org