我有一张看起来像这样的表:
我正在寻找一个表格,它给出了字段中元素的频率计数l_0, l_1, l_2, l_3。
例如,输出应如下所示:
| author_id | year | l_o.name | l_0.count| l1.name | l1.count | l2.name | l2.count| l3.name | l3.count|
| 2164089123 | 1987 | biology | 3 | botany | 3 | | | | |
| 2595831531 | 1987 | computer science | 2 | simulation | 2 | computer simulation | 2 | mathematical model | 2 |
Run Code Online (Sandbox Code Playgroud)
编辑:
在某些情况下,数组字段可能有不止一种类型的元素。例如l_0可能是 ['biology', 'biology', 'geometry', 'geometry']. 在这种情况下,输出为字段l_0, l_1, l_2, …