I have a list as follows:
PastValues = [76978.359, 71079.933, 75580.227]
I did:
PastValues2 = PastValues + [-value for value in PastValues]
to create the negative values of the values in the PastValues and to join them with the values in the PastValues and it gave me the following list PastValues2:
[76978.359, 71079.933, 75580.227, -76978.359, -71079.933, -75580.227]
I would like to know if there is a way to rearrange the values in the PastValues2 to be of the same order as in PastValues.
Desired output:
PastValues2 = [-76978.359, 76978.359, -71079.933, 71079.933, -75580.227, 75580.227]
Since in the PastValues list 76978.359 was the first element, I want the first 2 elements in the PastValues2 to be the negative and the positive values of it, respectively. Similarly for the other elements in the PastValues list. The negative values should come before the positive values