To process csv data set in Jupyter notebook
<p>I am worried to process data set developed in Sindhi language. I followed all steps but unable to process the data set. May any one help me in loading and importing csv file from local drive. 
I tried like:</p>

<pre><code>import csv
data C:\Users\mazhar\Anaconda3\Lib\site-packages\sindhi2.csv
</code></pre>

<p>got response like:</p>

<pre><code>File "&lt;ipython-input-71-6a0a9456deeb&gt;", line 1
    data C:\Users\mazhar\Anaconda3\Lib\site-packages\sindhi2.csv
         ^
SyntaxError: invalid syntax
</code></pre>

<p>then enter query as:</p>

<pre><code>import csv
with open(C:\Users\mazhar\Anaconda3\Lib\site-packages\sindhi2.csv, 'rb') as f:
    data = list(csv.reader(f))
</code></pre>

<p>and got response as:</p>

<pre><code>File "&lt;ipython-input-74-29f185d274e2&gt;", line 2
    with open(C:\Users\mazhar\Anaconda3\Lib\site-packages\sindhi2.csv, 'rb') as f:
               ^
SyntaxError: invalid syntax
</code></pre>

<p>than process as:</p>

<pre><code>from sklearn import datasets
sindhi2 = datasets.load_sindhi2()
digits = datasets.load_digits()
</code></pre>

<p>and got response as:</p>

<pre><code>AttributeError
Traceback (most recent call last)
&lt;ipython-input-9-119477fe5453&gt; in &lt;module&gt;()
      1 from sklearn import datasets
----&gt; 2 sindhi2 = datasets.load_sindhi2()
      3 digits = datasets.load_digits()

AttributeError: module 'sklearn.datasets' has no attribute 'load_sindhi2'
</code></pre>

<p>Please help me in loading and importing dataset from my local drive D and process POS tagging and feature deriving  in jupyter notebook</p>

<p>Your second block is almost correct, all you need is to quote the file name:</p>

<pre><code>import csv
with open(r'C:\Users\mazhar\Anaconda3\Lib\site-packages\sindhi2.csv', 'rb') as f:
    data = list(csv.reader(f))
</code></pre>

<p>Also note that I used raw string (see the <code>r</code> before the single quote) so that I don't have to escape the backspaces.</p>

<h1>Update</h1>

<p>Since you are using Python 3, you should use mode <code>'r'</code>:</p>

<pre><code>with open(r'C:\Users\mazhar\Anaconda3\Lib\site-packages\sindhi2.csv', 'r') as f:
</code></pre>

<p>Or omit the mode:</p>

<pre><code>with open(r'C:\Users\mazhar\Anaconda3\Lib\site-packages\sindhi2.csv') as f:
</code></pre>

<p>I have tried this with Anaconda + Python 3 Jupyter notebook.</p>

python csv jupyter tagging