New to pandas so sorry if this is old hat. What I'm trying to accomplish is similar to what is contained in grouping rows in list in pandas groupby, but I have more than two columns and can't figure out how to get all of my columns displayed along with the grouped value. Here's what I'm trying to do.
data = [{'ip': '192.168.1.1', 'make': 'Dell', 'model': 'UltraServ9000'},
{'ip': '192.168.1.3', 'make': 'Dell', 'model': 'MiniServ'},
{'ip': '192.168.1.5', 'make': 'Dell', 'model': 'UltraServ9000'},
{'ip': '192.168.1.6', 'make': 'HP', 'model': 'Thinger3000'},
{'ip': '192.168.1.8', 'make': 'HP', 'model': 'Thinger3000'}]
In [2]: df = pd.DataFrame(data)
In [3]: df
Out[4]:
ip make model
0 192.168.1.1 Dell UltraServ9000
1 192.168.1.3 Dell MiniServ
2 192.168.1.5 Dell UltraServ9000
3 192.168.1.6 HP Thinger3000
4 192.168.1.8 HP Thinger3000
<magic>
Out[?]:
ip make model
0 192.168.1.1, 192.168.1.5 Dell UltraServ9000
1 192.168.1.3 Dell MiniServ
3 192.168.1.6, 192.168.1.8 HP Thinger3000
Thanks in advance :)