我正在为 julia 中的数据帧中的一个系列寻找 Pandas 中非常方便的 value_counts 的等效项。
不幸的是,我在这里找不到任何东西,因此我对 julia 数据框中的 value_counts 的解决方案如下。但是,我不太喜欢我的解决方案,因为与使用方法的熊猫相比,它并不方便.value_counts()。所以我的问题是,还有其他(更方便)的选择吗?
jdf = DataFrame(rand(Int8, (1000000, 3)))
Run Code Online (Sandbox Code Playgroud)
这给了我:
? Row ? x1 ? x2 ? x3 ?
? ? Int8 ? Int8 ? Int8 ?
????????????????????????????????
? 1 ? -97 ? 98 ? 79 ?
? 2 ? -77 ? -118 ? -19 ?
?
? 999998 ? -115 ? 17 ? 107 ?
? 999999 ? -43 ? -64 ? 72 ?
? 1000000 ? 40 ? …Run Code Online (Sandbox Code Playgroud) julia ×1