gpt4 book ai didi

dictionary - Mathematica 中条件查询的映射选择

转载 作者:行者123 更新时间:2023-12-03 18:10:53 24 4
gpt4 key购买 nike

使用以下列表,

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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com