当试图找到一个单词在数据集中重复的次数时...例如,如果一列有East Northeast和West,我试图找到有多少东北有?
答案 0 :(得分:0)
在Javascript中:
const column = ['east', 'west', 'northeast', 'west', 'northeast', 'south'];
const frequency = column.filter(word => word === 'northeast').length
此处frequency
的值为2
答案 1 :(得分:0)
SQL:
SELECT COUNT(column) FROM dataset WHERE column LIKE '%Northeast%'
C#:
int count = dataSet.dataTable[0].AsEnumerable()
.Count(row => row.Field<string>("Column-A") == "Northeast");