I was wondering what would be the most efficient way to add brackets to given elements in my data set in order to change it's form from {{a,b},{c,d}} to {{{a},b},{{c},d}}.
I took a look through a few questions within the exchange database but couldn't find an answer which would output data in that form. I found an example for strings here, however,the output is a string which I can't manipulate as data (if that makes any sense).
My example data is as follows:
List = {{0.343051, 48.3831}, {0.331855, 81.4873}, {0.323979, 101.01}, {0.317126, 108.65}, {0.310429, 106.103}, {0.303265, 95.0686}, {0.294876, 77.2432}, {0.283812, 54.3249}, {0.265673, 28.0113}, {0., 0.00176955}, {-0.265673, 28.0113}, {-0.283812, 54.3249}, {-0.294876, 77.2433}, {-0.303265, 95.0686}, {-0.310429, 106.103}, {-0.317126, 108.65}, {-0.323979, 101.01}, {-0.331855, 81.4882}, {-0.343051, 48.3836}}
(I'm not looking for it to be done for a specific dataset of just this size, but rather for the more general case initially suggested)
My current method looks a bit like this:
Transpose@{Partition[List[[All,1]],1],List[[All,2]]}
where I separate the list into two and use partition to wrap all the first elements of list in a set of brackets and then transpose.
As the list size increases the timing becomes a bit too nonsensical. Could someone suggest a faster method please or possibly direct me to the answer?
Thanks in advance