i have a csv object that i loop through, each row with in the csv reader object is a list - what's the best way to convert that row object to a string?
i have a csv object that i loop through, each row with in the csv reader object is a list - what's the best way to convert that row object to a string?
I basically have something like this:
i have a csv object that i loop through, each row with in the csv reader object is a list - what's the best way to convert that row object to a string?
I basically have something like this:
```for m_row in msft_data:
m_symbol = 'MSFT'
m_row.insert(0,m_symbol)
line = str(m_row)
print(type(line))
print(line)```
output:
Guess I"m not sure why it's still contained within [ ] brackets like a list?
I basically have something like this:
for m_row in msft_data:
m_symbol = 'MSFT'
m_row.insert(0,m_symbol)
line = str(m_row)
print(type(line))
print(line)
i have a csv object that i loop through, each row with in the csv reader object is a list - what's the best way to convert that row object to a string?
I basically have something like this:
```for m_row in msft_data:
m_symbol = 'MSFT'
m_row.insert(0,m_symbol)
line = str(m_row)
print(type(line))
print(line)```
output:
<class 'str'>
['MSFT', '2019-01-31 11:40:00', '103.9300', '104.1900', '103.9150', '104.1700', '444704']
Guess I"m not sure why it's still contained within [ ] brackets like a list?
No any search results
You already invited:
1 Answers
Ali
Upvotes from: Benny
Or even `','.join(m_row)` since it looks like your numbers are strings to start with.