How to separate a CSV file when there are "" lines?
<p>When I am reading in a CSV file that looks like this:</p>

<pre><code>To, ,New York ,Norfolk ,Charleston ,Savannah 

Le Havre (Fri), ,15 ,18 ,22 ,24 

Rotterdam (Sun) ,"",13 ,16 ,20 ,22 

Hamburg (Thu) ,"",11 ,14 ,18 ,20 

Southampton (Fri) , "" ,8 ,11 ,15 ,17
</code></pre>

<p>using pandas, as follows:</p>

<pre><code>duration_route1 =  pd.read_csv(file_name, sep = ',')
</code></pre>

<p>I get the following result (I use Sublime Text to run my Python code):</p>

<p><a href="http://i.stack.imgur.com/jO08M.png" rel="nofollow"><img src="http://i.stack.imgur.com/jO08M.png" alt="enter image description here"></a></p>

<p>You see that when there is a <code>""</code>, it doesn't separate the string. Why does it not do this?</p>

<p>Just use csv library in python, 
import it and use .</p>

<pre><code>import csv

file_obj = #your_file_object_read_mode
rows = file_obj.readlines()

for raw in csv.DictReader(rows, delimiter=","):
    print(raw) # the raw will be a dictionary and you can use it well for any need. 
</code></pre>

<p>each raw will look like ie, </p>

<pre><code>{'number3': '88', 'number2': '22', 'name': 'vipul', 'number1': '23'}
</code></pre>

<p>This solves your problem I think, Just give it a try. </p>

python csv pandas