Skip to main content
added 417 characters in body
Source Link
kglr
  • 403.4k
  • 18
  • 501
  • 959
Join @@criteria MapThread[Select[#]@#2= &{criterion1, {criterion2} = {GreaterThan[.17], LessThan[.19]}; Join @@ MapThread[Select[#]@#2 &, {criteria, {list1, list2}}] 
{0.172804, 0.175326, 0.17098, 0.172789, 0.173099, 0.190308, 0.173863,0.143799, 0.181231} 

"how can I also find the positions in lists1 and 2 of each element that is appented in the joint list?"

KeySelect[criterion1] @ PositionIndex[list1] 
<|0.172804 -> {1}, 0.175326 -> {5}, 0.17098 -> {6}, 0.172789 -> {7}, 
 0.173099 -> {8}, 0.190308 -> {10}|> KeySelect[criterion2] @ PositionIndex[list2] 
<|0.173863 -> {1}, 0.143799 -> {9}, 0.181231 -> {10}|> 
Join @@ MapThread[Select[#]@#2 &, {{GreaterThan[.17], LessThan[.19]}, {list1, list2}}] 
{0.172804, 0.175326, 0.17098, 0.172789, 0.173099, 0.190308, 0.173863,0.143799, 0.181231} 
criteria = {criterion1, criterion2} = {GreaterThan[.17], LessThan[.19]}; Join @@ MapThread[Select[#]@#2 &, {criteria, {list1, list2}}] 
{0.172804, 0.175326, 0.17098, 0.172789, 0.173099, 0.190308, 0.173863,0.143799, 0.181231} 

"how can I also find the positions in lists1 and 2 of each element that is appented in the joint list?"

KeySelect[criterion1] @ PositionIndex[list1] 
<|0.172804 -> {1}, 0.175326 -> {5}, 0.17098 -> {6}, 0.172789 -> {7}, 
 0.173099 -> {8}, 0.190308 -> {10}|> KeySelect[criterion2] @ PositionIndex[list2] 
<|0.173863 -> {1}, 0.143799 -> {9}, 0.181231 -> {10}|> 
Source Link
kglr
  • 403.4k
  • 18
  • 501
  • 959

Join @@ MapThread[Select[#]@#2 &, {{GreaterThan[.17], LessThan[.19]}, {list1, list2}}] 
{0.172804, 0.175326, 0.17098, 0.172789, 0.173099, 0.190308, 0.173863,0.143799, 0.181231}