我有一个包含 A 列(字符)的表。 我想在数值中添加一个新列,表示 A 列的分组。 如何自动执行此操作? A 列有太多字符,我无法手动对它们进行分组。
可能可以使用 Cols --> Utilities --> Labels to Code (它会自动分配基于字母顺序的代码)?

然后使用以下公式创建新列;
:新列 << 设置公式( Col 存储值( :Column A ) );
还有一个问题是代码是按顺序给出的。 我想知道是否有一种方法可以根据 A 列中出现次数最多的次数来分配数字。
要根据 A 列中最高出现次数分配数字,需要一些解决方法。
1. 按组创建汇总表,“A 列”--> 对 N 列“降序”排序
2.添加公式列:new result = Row();
3. 连接两个表或更新主表以匹配“A 列”。

如果您使用脚本,则需要如下几行;
// → Data Table( "Untitled" )
New Table( "Untitled" );
// Data table summary
// → Data Table( "Untitled By (Column A)" )
Data Table( "Untitled" ) << Summary(
Group( :Column A ),
Freq( "None" ),
Weight( "None" )
);
// Sort data table
Data Table( "Untitled By (Column A)" ) << Sort(
By( :N Rows ),
Replace Table,
Order( Descending )
);
// New column: new result
Data Table( "Untitled By (Column A)" ) << New Column( "new result",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( Row() )
);
// Update data tables
Data Table( "Untitled" ) << Update(
With( Data Table( "Untitled By (Column A)" ) ),
Match Columns( :Column A = :Column A )
);希望能帮助到你。