On Monday, February 27, 2017 at 4:27:23 PM UTC-5, Pavol Lisy wrote:
> On 2/27/17, Andrew Zyman wrote:
> I think you meant:
> colnames = ['hostname']
arh... Exactly. Now the rest is "unfolding".
> What do you want is probably:
> >>> data[colnames[0]].tolist()
this is great
On 2/27/17, Andrew Zyman wrote:
> Hello,
> i'm trying to understand what is the difference between the below code.
> And how do i access the column's data without hardcoding the column name in
> such a way that i'll be able to convert it's values into the list of
> strings?
>
Hello,
i'd appreciate an explanation about the differences in the code versions
below. I'm trying to get the list of the strings out of the column and avoid
hardcoding the column name.
cat Data/2domain.csv
hostname
hostname1
hostname2
...
...
Working version(s):
Python2.7:
input_file =
Hello,
i'm trying to understand what is the difference between the below code.
And how do i access the column's data without hardcoding the column name in
such a way that i'll be able to convert it's values into the list of strings?
I appreciate your help.
Short version:
colnames='hostname'