3
如何遍历分组的熊猫数据框?
数据框: c_os_family_ss c_os_major_is l_customer_id_i 0 Windows 7 90418 1 Windows 7 90418 2 Windows 7 90418 码: print df for name, group in df.groupby('l_customer_id_i').agg(lambda x: ','.join(x)): print name print group 我正在尝试仅遍历聚合数据,但出现错误: ValueError:太多值无法解包 @EdChum,这是预期的输出: c_os_family_ss \ l_customer_id_i 131572 Windows 7,Windows 7,Windows 7,Windows 7,Window... 135467 Windows 7,Windows 7,Windows 7,Windows 7,Window... c_os_major_is l_customer_id_i …