Skip to main content
added 138 characters in body
Source Link
eldo
  • 83.1k
  • 6
  • 72
  • 202

If you want to "safe" your original data make a copy.

data = {{{44.5, 0.00185}, {45.2, 0.00186}, {45.5, 0.00186}}, {{48.6, 0.00186}, {49.2, 0.00209}, {49.9, 0.00109}}};

copy = data;

copy[[All, All, 2]] *= 2

copy // MatrixForm

enter image description here

If you want to change data permanently it's just

 data[[All, All, 2]] *= 2

You obtain the same result with ReplaceAll

data /. {a_, b_?NumericQ} :> {a, 2 b}

(ReplaceAll can become slow on large lists)

If you want to "safe" your original data make a copy.

data = {{{44.5, 0.00185}, {45.2, 0.00186}, {45.5, 0.00186}}, {{48.6, 0.00186}, {49.2, 0.00209}, {49.9, 0.00109}}};

copy = data;

copy[[All, All, 2]] *= 2

copy // MatrixForm

enter image description here

If you want to change data permanently it's just

 data[[All, All, 2]] *= 2

If you want to "safe" your original data make a copy.

data = {{{44.5, 0.00185}, {45.2, 0.00186}, {45.5, 0.00186}}, {{48.6, 0.00186}, {49.2, 0.00209}, {49.9, 0.00109}}};

copy = data;

copy[[All, All, 2]] *= 2

copy // MatrixForm

enter image description here

If you want to change data permanently it's just

 data[[All, All, 2]] *= 2

You obtain the same result with ReplaceAll

data /. {a_, b_?NumericQ} :> {a, 2 b}

(ReplaceAll can become slow on large lists)

added 149 characters in body
Source Link
eldo
  • 83.1k
  • 6
  • 72
  • 202

If you want to "safe" your original data make a copy.

data = {{{44.5, 0.00185}, {45.2, 0.00186}, {45.5, 0.00186}}, {{48.6, 0.00186}, {49.2, 0.00209}, {49.9, 0.00109}}};

copy = data;

copy[[All, All, 2]] *= 2

copy // MatrixForm

enter image description here

If you want to change data permanently it's just

 data[[All, All, 2]] *= 2
data = {{{44.5, 0.00185}, {45.2, 0.00186}, {45.5, 0.00186}}, {{48.6, 0.00186}, {49.2, 0.00209}, {49.9, 0.00109}}};

copy = data;

copy[[All, All, 2]] *= 2

copy // MatrixForm

enter image description here

If you want to "safe" your original data make a copy.

data = {{{44.5, 0.00185}, {45.2, 0.00186}, {45.5, 0.00186}}, {{48.6, 0.00186}, {49.2, 0.00209}, {49.9, 0.00109}}};

copy = data;

copy[[All, All, 2]] *= 2

copy // MatrixForm

enter image description here

If you want to change data permanently it's just

 data[[All, All, 2]] *= 2
Source Link
eldo
  • 83.1k
  • 6
  • 72
  • 202

data = {{{44.5, 0.00185}, {45.2, 0.00186}, {45.5, 0.00186}}, {{48.6, 0.00186}, {49.2, 0.00209}, {49.9, 0.00109}}};

copy = data;

copy[[All, All, 2]] *= 2

copy // MatrixForm

enter image description here