Reading text file with numpy.loadtxt
<p>I am getting an error when trying to read a text file. </p>

<pre><code>import numpy as np

fnam = 'file.txt'
test_fnames = np.loadtxt(fnam, dtype=None, delimiter=',')
test_fnames
</code></pre>

<p>I now get this error:</p>

<pre><code>ValueError: could not convert string to float: 
</code></pre>

<p>The file content is just a comma separated list of numbers. Perhaps there is a space at the end of the file that is causing an error?</p>

<pre><code>1,2,3,4,5,6,7,7,8,9122,3,3,45,5,6 
</code></pre>

<p>Thanks. The problem was the way I wrote the text file in Torch7. </p>