On Monday, February 27, 2017 at 4:27:23 PM UTC-5, Pavol Lisy wrote: > On 2/27/17, Andrew Zyman <x...@gmail.com> wrote: <skip> > I think you meant: > colnames = ['hostname']
arh... Exactly. Now the rest is "unfolding". <skip> > What do you want is probably: > >>> data[colnames[0]].tolist() this is great and the rest of the code works. but the output of "list_data = data.hostname.tolist()" is the comma separated strings, and "list_data = data[colnames[0]].get_values()" is space separated list. I suspect the answer to my "why" is in your statements below . > or maybe if you don't want to remember colnames: > >>> data[data.columns[0]].tolist() > Be careful! Type of data[x] depend on what type is x. > >>> type(data['hostname']) # -> pandas.core.series.Series > >>> type(data[['hostname']]) # -> pandas.core.frame.DataFrame Thank you Pavol, very helpful. -- https://mail.python.org/mailman/listinfo/python-list