使用以下列表,
list = {{a, b, c, d}, {1, 2, 3, 4}, {5, 6, 7, 8}};
是否可以选择第二个值 >3 的列表。下面所需的输出
{5, 6, 7, 8}
调整以下代码,当前提取列表中所有 >2 的值
Select[#, # > 2 &] & /@ list[[2 ;;]
可在此处找到复杂的查询解决方案 Conditional Data Manipulation in Mathematica
最佳答案
或者,使用 Select
Select[list, #[[2]] > 3 &]
输出
{{5, 6, 7, 8}}
关于dictionary - Mathematica 中条件查询的映射选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6234828/