I have the following list containing 2-element sublists:
list={{0.01, 0.037348}, {0.03, 0.165434}, {0.1, 0.263921}, {0.3,
0.560191}, {1., 0.968857}, {3., 1.50965}, {10., 2.36502}, {30.,
3.07659}, {100., 3.73412}, {300., 4.4931}, {1000., 5.06818}, {3000.,
5.65423}, {10000., 6.00944}}
How can I get the natural logarithm (Log[]
) of the first element of each sublist (e.g. 0.01, 0.03.....10000) only while leaving the second one intact?. I would like this operation to apply to other sublists of different lengths.
{Log[First[#]],Last[#]}&/@list
will make a new list with log of the first element. $\endgroup${Log@#1, #2} & @@@ list
. There are many similar questions and this will be signed as a duplicate. $\endgroup$list[[All,1]]=Log@list[[All,1]]
$\endgroup$ListLogPlot
,ListLogLinearPlot
, and/orListLogLogPlot
. $\endgroup$