test is a pandas dataframe converted to string.
strtest = (test.to_string())
print strtest
After conversion to string, I have the following output:
This is the first test file 98128612.12
This is the second test file 31236164.15
I am trying to have each line of the string placed into a list and printed out to look like this:
['This is the first test file','98128612.12']
['This is the second test file','31236164.15']
This are my codes when attempting to produce the output above in lists:
testlist = []
for row in strtest.iterrows():
index, data = row
testlist.append(data.tolist())
print testlist
However when I run it, I am having this error how do I solve this:
for row in strtest.iterrows():
AttributeError: 'unicode' object has no attribute 'iterrows'