We have data in a list called megadata
where megadata[[1]]
for instance are the temperatures of each data point, megadata[[2]]
are the pressures, etc. We are trying to selectively remove data points to see how it changes our fits but I have been unable to get Delete
or Drop
or anything else to work. I need something to let me remove the same position from every nested list within the list. So for instance if I wanted to delete positions 2 and 3 I need something to change megadata = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}}
into `megadata = {{1, 4}, {5, 8}, {9, 12}.
Edit: I'm really new to Mathematica (learning ahead of the semester as part of undergraduate research) so I'm having trouble understanding some of the comments made. I used the Drop[#, {2, 3}] & /@ megadata idea and it worked quite nicely for removing adjacent points but my nested lists have a length of 12 and when I would try using it as Drop[#, {4, 7}] & /@ megadata, it seemed to remove all the points between 4 and 7 (so it would remove 4,5,6, and 7). Is there anyway to modify this format slightly to make it not remove that whole range of points and only remove 4 and 7?
Edit 2: I actually think I found the answer. Didn't see the link to the duplicate answer above. Sorry real new to all of this. Thanks for all the help though!
megadata[[All, {1, 4}]]
$\endgroup$Cases
with some sort of condition applied to a pattern. But we'd need an example of your real data. $\endgroup$list /. {a_, b_, c_, d_} :> {a, d}
? $\endgroup$