Certain list transformHow to find the phase difference of two sampled sine waves?Efficiently extracting an...
The best in flight meal option for those suffering from reflux
Past vs. present tense when referring to a fictional character
Is it ethical to cite a reviewer's papers even if they are rather irrelevant?
How to search for Android apps without ads?
Why did the AvroCar fail to fly above 3 feet?
What's the reason for the decade jump in the recent X-Men trilogy?
How can I find out about the game world without meta-influencing it?
ISP is not hashing the password I log in with online. Should I take any action?
Can an open source licence be revoked if it violates employer's IP?
Am I allowed to determine tenets of my contract as a warlock?
Interview was just a one hour panel. Got an offer the next day; do I accept or is this a red flag?
What game uses dice with compass point arrows, forbidden signs, explosions, arrows and targeting reticles?
Was the Lonely Mountain, where Smaug lived, a volcano?
Is it a good security practice to force employees hide their employer to avoid being targeted?
What do I need to do, tax-wise, for a sudden windfall?
Is all-caps blackletter no longer taboo?
Boss making me feel guilty for leaving the company at the end of my internship
Idiom for 'person who gets violent when drunk"
Arrows inside a commutative diagram using tikzcd
Why are backslashes included in this shell script?
A flower's head or heart?
Print the phrase "And she said, 'But that's his.'" using only the alphabet
Jam with honey & without pectin has a saucy consistency always
Does every chapter have to "blow the reader away" so to speak?
Certain list transform
How to find the phase difference of two sampled sine waves?Efficiently extracting an array subset given a separate arrayDeleting parts of groups that do not have equal datesModifying a list of matrices with conditional statementAdd values from a list, at positions from a list, to a matrixUnion of two or more listsChanging the first row of a matrix; subsequent rows depend on the first rowCustom labels in colorbarspecial boolean operatorEfficiency in array element replacement
$begingroup$
I imported three lists
list1={{0.01, 0., 0.00242439}, {0.06, 0., 0.00228538},
{0.11, 0., 0.0018987}, {0.16, 0., 0.00148493},
{0.21, 0., 0.00104764}, {0.26, 0., 0.000575535},
{0.31, 0., 0.000068559}};
list2={{0.01, 0., 0.00242439}, {0.06, 0., 0.00237076},
{0.11, 0., 0.00211971}, {0.16, 0., 0.001817},
{0.21, 0., 0.00150603}, {0.26, 0., 0.00118223},
{0.31, 0., 0.000839701}};
list3={{0.01, 0., 0.00242439}, {0.06, 0., 0.00240639},
{0.11, 0., 0.00225701}, {0.16, 0., 0.00203365},
{0.21, 0., 0.00179651}, {0.26, 0., 0.00155504},
{0.31, 0., 0.00130653}};
I wish to add the third column of all lists with each other and keep unchanged two same columns. For example:
result= {{0.01, 0., 0.00727317},{0.06, 0., 0.00706253},...}
How do I reach this goal?
list-manipulation
$endgroup$
add a comment |
$begingroup$
I imported three lists
list1={{0.01, 0., 0.00242439}, {0.06, 0., 0.00228538},
{0.11, 0., 0.0018987}, {0.16, 0., 0.00148493},
{0.21, 0., 0.00104764}, {0.26, 0., 0.000575535},
{0.31, 0., 0.000068559}};
list2={{0.01, 0., 0.00242439}, {0.06, 0., 0.00237076},
{0.11, 0., 0.00211971}, {0.16, 0., 0.001817},
{0.21, 0., 0.00150603}, {0.26, 0., 0.00118223},
{0.31, 0., 0.000839701}};
list3={{0.01, 0., 0.00242439}, {0.06, 0., 0.00240639},
{0.11, 0., 0.00225701}, {0.16, 0., 0.00203365},
{0.21, 0., 0.00179651}, {0.26, 0., 0.00155504},
{0.31, 0., 0.00130653}};
I wish to add the third column of all lists with each other and keep unchanged two same columns. For example:
result= {{0.01, 0., 0.00727317},{0.06, 0., 0.00706253},...}
How do I reach this goal?
list-manipulation
$endgroup$
add a comment |
$begingroup$
I imported three lists
list1={{0.01, 0., 0.00242439}, {0.06, 0., 0.00228538},
{0.11, 0., 0.0018987}, {0.16, 0., 0.00148493},
{0.21, 0., 0.00104764}, {0.26, 0., 0.000575535},
{0.31, 0., 0.000068559}};
list2={{0.01, 0., 0.00242439}, {0.06, 0., 0.00237076},
{0.11, 0., 0.00211971}, {0.16, 0., 0.001817},
{0.21, 0., 0.00150603}, {0.26, 0., 0.00118223},
{0.31, 0., 0.000839701}};
list3={{0.01, 0., 0.00242439}, {0.06, 0., 0.00240639},
{0.11, 0., 0.00225701}, {0.16, 0., 0.00203365},
{0.21, 0., 0.00179651}, {0.26, 0., 0.00155504},
{0.31, 0., 0.00130653}};
I wish to add the third column of all lists with each other and keep unchanged two same columns. For example:
result= {{0.01, 0., 0.00727317},{0.06, 0., 0.00706253},...}
How do I reach this goal?
list-manipulation
$endgroup$
I imported three lists
list1={{0.01, 0., 0.00242439}, {0.06, 0., 0.00228538},
{0.11, 0., 0.0018987}, {0.16, 0., 0.00148493},
{0.21, 0., 0.00104764}, {0.26, 0., 0.000575535},
{0.31, 0., 0.000068559}};
list2={{0.01, 0., 0.00242439}, {0.06, 0., 0.00237076},
{0.11, 0., 0.00211971}, {0.16, 0., 0.001817},
{0.21, 0., 0.00150603}, {0.26, 0., 0.00118223},
{0.31, 0., 0.000839701}};
list3={{0.01, 0., 0.00242439}, {0.06, 0., 0.00240639},
{0.11, 0., 0.00225701}, {0.16, 0., 0.00203365},
{0.21, 0., 0.00179651}, {0.26, 0., 0.00155504},
{0.31, 0., 0.00130653}};
I wish to add the third column of all lists with each other and keep unchanged two same columns. For example:
result= {{0.01, 0., 0.00727317},{0.06, 0., 0.00706253},...}
How do I reach this goal?
list-manipulation
list-manipulation
edited 8 hours ago
user64494
3,98111323
3,98111323
asked 8 hours ago
Inzo BabariaInzo Babaria
48129
48129
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
$begingroup$
list4 = list1;
list4[[All, 3]] = Total[{list1, list2, list3}[[All, All, 3]]];
list4
{{0.01,0.,0.00727317},{0.06,0.,0.00706253},{0.11,0.,0.00627542},{0.16,0.,0.00533558},{0.21,0.,0.00435018},{0.26,0.,0.00331281},{0.31,0.,0.00221479}}
Also
KeyValueMap[Append]@Merge[Total][#[[;;2]]->#[[3]]&/@Join[list1,list2,list3]]
same result
$endgroup$
add a comment |
$begingroup$
{#1/3, #2/3, #3} & @@@ (list1 + list2 + list3)
{{0.01, 0., 0.00727317}, {0.06, 0., 0.00706253}, {0.11, 0.,
0.00627542}, {0.16, 0., 0.00533558}, {0.21, 0., 0.00435018}, {0.26,
0., 0.00331281}, {0.31, 0., 0.00221479}}
$endgroup$
add a comment |
$begingroup$
list1 + list2.DiagonalMatrix[{0, 0, 1}]+ list3.DiagonalMatrix[{0, 0, 1}]
{{0.01, 0., 0.00727317}, {0.06, 0., 0.00706253}, {0.11, 0., 0.00627542}, {0.16, 0., 0.00533558}, {0.21, 0., 0.00435018}, {0.26, 0., 0.00331281}, {0.31, 0., 0.00221479}}
$endgroup$
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "387"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f200228%2fcertain-list-transform%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
list4 = list1;
list4[[All, 3]] = Total[{list1, list2, list3}[[All, All, 3]]];
list4
{{0.01,0.,0.00727317},{0.06,0.,0.00706253},{0.11,0.,0.00627542},{0.16,0.,0.00533558},{0.21,0.,0.00435018},{0.26,0.,0.00331281},{0.31,0.,0.00221479}}
Also
KeyValueMap[Append]@Merge[Total][#[[;;2]]->#[[3]]&/@Join[list1,list2,list3]]
same result
$endgroup$
add a comment |
$begingroup$
list4 = list1;
list4[[All, 3]] = Total[{list1, list2, list3}[[All, All, 3]]];
list4
{{0.01,0.,0.00727317},{0.06,0.,0.00706253},{0.11,0.,0.00627542},{0.16,0.,0.00533558},{0.21,0.,0.00435018},{0.26,0.,0.00331281},{0.31,0.,0.00221479}}
Also
KeyValueMap[Append]@Merge[Total][#[[;;2]]->#[[3]]&/@Join[list1,list2,list3]]
same result
$endgroup$
add a comment |
$begingroup$
list4 = list1;
list4[[All, 3]] = Total[{list1, list2, list3}[[All, All, 3]]];
list4
{{0.01,0.,0.00727317},{0.06,0.,0.00706253},{0.11,0.,0.00627542},{0.16,0.,0.00533558},{0.21,0.,0.00435018},{0.26,0.,0.00331281},{0.31,0.,0.00221479}}
Also
KeyValueMap[Append]@Merge[Total][#[[;;2]]->#[[3]]&/@Join[list1,list2,list3]]
same result
$endgroup$
list4 = list1;
list4[[All, 3]] = Total[{list1, list2, list3}[[All, All, 3]]];
list4
{{0.01,0.,0.00727317},{0.06,0.,0.00706253},{0.11,0.,0.00627542},{0.16,0.,0.00533558},{0.21,0.,0.00435018},{0.26,0.,0.00331281},{0.31,0.,0.00221479}}
Also
KeyValueMap[Append]@Merge[Total][#[[;;2]]->#[[3]]&/@Join[list1,list2,list3]]
same result
edited 8 hours ago
answered 8 hours ago
kglrkglr
198k10222446
198k10222446
add a comment |
add a comment |
$begingroup$
{#1/3, #2/3, #3} & @@@ (list1 + list2 + list3)
{{0.01, 0., 0.00727317}, {0.06, 0., 0.00706253}, {0.11, 0.,
0.00627542}, {0.16, 0., 0.00533558}, {0.21, 0., 0.00435018}, {0.26,
0., 0.00331281}, {0.31, 0., 0.00221479}}
$endgroup$
add a comment |
$begingroup$
{#1/3, #2/3, #3} & @@@ (list1 + list2 + list3)
{{0.01, 0., 0.00727317}, {0.06, 0., 0.00706253}, {0.11, 0.,
0.00627542}, {0.16, 0., 0.00533558}, {0.21, 0., 0.00435018}, {0.26,
0., 0.00331281}, {0.31, 0., 0.00221479}}
$endgroup$
add a comment |
$begingroup$
{#1/3, #2/3, #3} & @@@ (list1 + list2 + list3)
{{0.01, 0., 0.00727317}, {0.06, 0., 0.00706253}, {0.11, 0.,
0.00627542}, {0.16, 0., 0.00533558}, {0.21, 0., 0.00435018}, {0.26,
0., 0.00331281}, {0.31, 0., 0.00221479}}
$endgroup$
{#1/3, #2/3, #3} & @@@ (list1 + list2 + list3)
{{0.01, 0., 0.00727317}, {0.06, 0., 0.00706253}, {0.11, 0.,
0.00627542}, {0.16, 0., 0.00533558}, {0.21, 0., 0.00435018}, {0.26,
0., 0.00331281}, {0.31, 0., 0.00221479}}
answered 8 hours ago
Anjan KumarAnjan Kumar
4,10311026
4,10311026
add a comment |
add a comment |
$begingroup$
list1 + list2.DiagonalMatrix[{0, 0, 1}]+ list3.DiagonalMatrix[{0, 0, 1}]
{{0.01, 0., 0.00727317}, {0.06, 0., 0.00706253}, {0.11, 0., 0.00627542}, {0.16, 0., 0.00533558}, {0.21, 0., 0.00435018}, {0.26, 0., 0.00331281}, {0.31, 0., 0.00221479}}
$endgroup$
add a comment |
$begingroup$
list1 + list2.DiagonalMatrix[{0, 0, 1}]+ list3.DiagonalMatrix[{0, 0, 1}]
{{0.01, 0., 0.00727317}, {0.06, 0., 0.00706253}, {0.11, 0., 0.00627542}, {0.16, 0., 0.00533558}, {0.21, 0., 0.00435018}, {0.26, 0., 0.00331281}, {0.31, 0., 0.00221479}}
$endgroup$
add a comment |
$begingroup$
list1 + list2.DiagonalMatrix[{0, 0, 1}]+ list3.DiagonalMatrix[{0, 0, 1}]
{{0.01, 0., 0.00727317}, {0.06, 0., 0.00706253}, {0.11, 0., 0.00627542}, {0.16, 0., 0.00533558}, {0.21, 0., 0.00435018}, {0.26, 0., 0.00331281}, {0.31, 0., 0.00221479}}
$endgroup$
list1 + list2.DiagonalMatrix[{0, 0, 1}]+ list3.DiagonalMatrix[{0, 0, 1}]
{{0.01, 0., 0.00727317}, {0.06, 0., 0.00706253}, {0.11, 0., 0.00627542}, {0.16, 0., 0.00533558}, {0.21, 0., 0.00435018}, {0.26, 0., 0.00331281}, {0.31, 0., 0.00221479}}
answered 2 hours ago
user1066user1066
6,27822033
6,27822033
add a comment |
add a comment |
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f200228%2fcertain-list-transform%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown