[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

How to combine 2 list in mathematica

I have 2 list:

cumlativeNetProfitLoss = Drop[FoldList[Plus, 0, listNetProfitLoss], 1]

{1.11, 2.07, 2.75, 3.49, 3.79, 10.2, 11.03, 19.84, 22.07, 23.29}

and

dateList = Reverse[dateNetProfitLoss[[All, 1]]]
{{2011, 8, 31}, {2011, 9, 2}, {2011, 9, 6}, {2011, 9, 20}, {2011, 9, 21}, {2011, 9, 22}, {2011, 9, 28}, {2011, 9, 30}, {2011, 10, 4}, {2011, 10, 10}}

 
 


How to I get:

{{{2011, 8, 31}, 1.11}, {{2011, 9, 2}, 2.07}, {{2011, 9, 6}, 2.75}, {{2011, 9, 20}, 3.49}, {{2011, 9, 21}, 3.79}, {{2011, 9, 22}, 10.2}, {{2011, 9, 28}, 11.03}, {{2011, 9, 30}, 19.84}, {{2011, 10, 4}, 22.07}, {{2011, 10, 10}, 23.29}}

Alternate:

(
    {2011,8,31} 1.11
    {2011,9,2}      2.07
    {2011,9,6}      2.75
    {2011,9,20}      3.49
    {2011,9,21}      3.79
    {2011,9,22}      10.2
    {2011,9,28}      11.03
    {2011,9,30}      19.84
    {2011,10,4}      22.07
    {2011,10,10} 23.29
)
Thanks in advance
0
John_2357
Asked:
John_2357
1 Solution
 
TommySzalapskiCommented:
Just add the new data as a fourth column. Either just add another column to the current matrix or make a new matrix with a width of four.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now