[英]group dataframe using unique values of column as index
What is the most efficient way of group or stack the different values of dataframe indexing by value?按值对数据帧索引的不同值进行分组或堆叠的最有效方法是什么?
this df:这个 df:
color alert
blue A
blue B
red A
green C
to:到:
color alert
blue [A, B]
red A
green C
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.