I am trying to perform a calculation on a list containing sublists.
More exact: The x-axis values are time data, progressing from zero, the y-axis data are data points, which I want to normalize. I want the y data to have their minimum at zero. Therefore, I look for the smallest y value in each sublist and add or subtract (depending if it is positive or negative) from all other y values of that sublist. I want to perform the calculation for all sublists.
I think I haven't quite understood what the Slot (#
) exactly does?!
I post here just an example list illustrating my problem, since the real list is very long.
My approach:
list={{{0,-0.1},{1,0.5},{2,0.7},{3,1.2},{4,0.6},{5,0.5},{6,1.3}},{{0,0.1},{1,0.5},{2,0.3},{3,0.7},{4,0.8},{5,1.1},{6,1.2}}}
list//{#[[1]],(#[[2]]-Min[#[[All,2]]])}&/@#&
This approach gives the following errors:
Part::partw: Part 1 of {} does not exist. >>
Part::partw: Part 2 of {} does not exist. >>
Part::partw: Part 1 of {} does not exist. >>
General::stop: Further output of Part::partw will be suppressed during this calculation. >>
Rescale[]
. $\endgroup$