This is the part of my code which works fine;
#taking time average
average= sum(result.expect[0])/len(t)
averagelist=[]
averagelist.append([num-Delta, average])
print(averagelist)
Giving output;
[[-50, 0.99994894092412567]]
[[-45, 0.9999371327219414]]
[[-40, 0.99992064521708557]]
[[-35, 0.99989662709502258]]
[[-30, 0.99985966374414359]]
[[-25, 0.99979843838324323]]
[[-20, 0.99968609192147129]]
[[-15, 0.99944283644552467]]
[[-10, 0.99874864586107459]]
[[-5, 0.99499296595818931]]
[[0, 0.50250021597634276]]
Now I want to be able to make a new list x= -50,-45,-40 etc and new list y= 0.999..., 0.999..., 0.999... etc Is there a simple way to do this? (I have also tried the extend as oppose to append function, and this gives me the same initial output but with one square bracket not two.)
You could use this :
list_x = [i[0] for i in averagelist]
list_y = [i[1] for i in averagelist]