<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="pd.DataFrame({&quot;col1&quot;: [&quot;NA&quot;], &quot;col2&quot;: [&quot;NA&quot;]}).to_csv(&quot;test.csv&quot;, index=False, header=None)

output = pd.read_csv(&quot;test.csv&quot;, header=None, names=[&quot;iso2&quot;, &quot;region&quot;], index_col=&quot;iso2&quot;, na_filter=False)
print(output)
"><pre class="notranslate"><span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>({<span class="pl-s">"col1"</span>: [<span class="pl-s">"NA"</span>], <span class="pl-s">"col2"</span>: [<span class="pl-s">"NA"</span>]}).<span class="pl-en">to_csv</span>(<span class="pl-s">"test.csv"</span>, <span class="pl-s1">index</span><span class="pl-c1">=</span><span class="pl-c1">False</span>, <span class="pl-s1">header</span><span class="pl-c1">=</span><span class="pl-c1">None</span>)

<span class="pl-s1">output</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">read_csv</span>(<span class="pl-s">"test.csv"</span>, <span class="pl-s1">header</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">names</span><span class="pl-c1">=</span>[<span class="pl-s">"iso2"</span>, <span class="pl-s">"region"</span>], <span class="pl-s1">index_col</span><span class="pl-c1">=</span><span class="pl-s">"iso2"</span>, <span class="pl-s1">na_filter</span><span class="pl-c1">=</span><span class="pl-c1">False</span>)
<span class="pl-en">print</span>(<span class="pl-s1">output</span>)</pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">Reading the file, "test.csv", with na_filter set to false, causes a "NA" to be read as a nan when that column is converted into the index. Reading the file without index_col and then converting works.</p>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">The index should contain the string "NA", not the float nan.</p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 3.6.2.final.0<br>
python-bits: 64<br>
OS: Windows<br>
OS-release: 10<br>
machine: AMD64<br>
processor: Intel64 Family 6 Model 94 Stepping 3, GenuineIntel<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: None<br>
LOCALE: None.None<br>
pandas: 0.20.3<br>
pytest: 3.2.3<br>
pip: 9.0.1<br>
setuptools: 36.5.0<br>
Cython: None<br>
numpy: 1.13.1<br>
scipy: 1.0.0b1<br>
xarray: None<br>
IPython: None<br>
sphinx: None<br>
patsy: 0.4.1<br>
dateutil: 2.6.1<br>
pytz: 2017.2<br>
blosc: None<br>
bottleneck: None<br>
tables: None<br>
numexpr: None<br>
feather: None<br>
matplotlib: 2.0.2<br>
openpyxl: 2.4.8<br>
xlrd: 1.1.0<br>
xlwt: None<br>
xlsxwriter: None<br>
lxml: None<br>
bs4: 4.6.0<br>
html5lib: None<br>
sqlalchemy: None<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: None<br>
s3fs: None<br>
pandas_gbq: None<br>
pandas_datareader: None</p>
</details>
<p dir="auto">Given the following CSV file:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="u1,u2,u3,d1,d2,d3,d4
Good Things,C,,1,1,1,1
Good Things,R,,1,1,1,1
Bad Things,C,,1,1,1,1
Bad Things,T,,1,1,1,1
Okay Things,N,B,1,1,1,1
Okay Things,N,D,1,1,1,1
Okay Things,B,,1,1,1,1
Okay Things,D,,1,1,1,1"><pre class="notranslate"><code class="notranslate">u1,u2,u3,d1,d2,d3,d4
Good Things,C,,1,1,1,1
Good Things,R,,1,1,1,1
Bad Things,C,,1,1,1,1
Bad Things,T,,1,1,1,1
Okay Things,N,B,1,1,1,1
Okay Things,N,D,1,1,1,1
Okay Things,B,,1,1,1,1
Okay Things,D,,1,1,1,1
</code></pre></div>
<p dir="auto">First I parse with <code class="notranslate">na_filter=True</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [13]: pd.read_csv(&quot;/home/alex/nan_issue.csv&quot;, na_filter=True)
Out[13]: 
            u1 u2   u3  d1  d2  d3  d4
0  Good Things  C  NaN   1   1   1   1
1  Good Things  R  NaN   1   1   1   1
2   Bad Things  C  NaN   1   1   1   1
3   Bad Things  T  NaN   1   1   1   1
4  Okay Things  N    B   1   1   1   1
5  Okay Things  N    D   1   1   1   1
6  Okay Things  B  NaN   1   1   1   1
7  Okay Things  D  NaN   1   1   1   1"><pre class="notranslate"><code class="notranslate">In [13]: pd.read_csv("/home/alex/nan_issue.csv", na_filter=True)
Out[13]: 
            u1 u2   u3  d1  d2  d3  d4
0  Good Things  C  NaN   1   1   1   1
1  Good Things  R  NaN   1   1   1   1
2   Bad Things  C  NaN   1   1   1   1
3   Bad Things  T  NaN   1   1   1   1
4  Okay Things  N    B   1   1   1   1
5  Okay Things  N    D   1   1   1   1
6  Okay Things  B  NaN   1   1   1   1
7  Okay Things  D  NaN   1   1   1   1
</code></pre></div>
<p dir="auto">then I parse with <code class="notranslate">na_filter=False</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [12]: pd.read_csv(&quot;/home/alex/nan_issue.csv&quot;, na_filter=False)
Out[12]: 
            u1 u2 u3  d1  d2  d3  d4
0  Good Things  C      1   1   1   1
1  Good Things  R      1   1   1   1
2   Bad Things  C      1   1   1   1
3   Bad Things  T      1   1   1   1
4  Okay Things  N  B   1   1   1   1
5  Okay Things  N  D   1   1   1   1
6  Okay Things  B      1   1   1   1
7  Okay Things  D      1   1   1   1"><pre class="notranslate"><code class="notranslate">In [12]: pd.read_csv("/home/alex/nan_issue.csv", na_filter=False)
Out[12]: 
            u1 u2 u3  d1  d2  d3  d4
0  Good Things  C      1   1   1   1
1  Good Things  R      1   1   1   1
2   Bad Things  C      1   1   1   1
3   Bad Things  T      1   1   1   1
4  Okay Things  N  B   1   1   1   1
5  Okay Things  N  D   1   1   1   1
6  Okay Things  B      1   1   1   1
7  Okay Things  D      1   1   1   1
</code></pre></div>
<p dir="auto">then <code class="notranslate">index_cols</code> set:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [11]: pd.read_csv(&quot;/home/alex/nan_issue.csv&quot;, na_filter=False,index_col=[0,1,2],)
Out[11]: 
                    d1  d2  d3  d4
u1          u2 u3                 
Good Things C  NaN   1   1   1   1
            R  NaN   1   1   1   1
Bad Things  C  NaN   1   1   1   1
            T  NaN   1   1   1   1
Okay Things N  B     1   1   1   1
               D     1   1   1   1
            B  NaN   1   1   1   1
            D  NaN   1   1   1   1"><pre class="notranslate"><code class="notranslate">In [11]: pd.read_csv("/home/alex/nan_issue.csv", na_filter=False,index_col=[0,1,2],)
Out[11]: 
                    d1  d2  d3  d4
u1          u2 u3                 
Good Things C  NaN   1   1   1   1
            R  NaN   1   1   1   1
Bad Things  C  NaN   1   1   1   1
            T  NaN   1   1   1   1
Okay Things N  B     1   1   1   1
               D     1   1   1   1
            B  NaN   1   1   1   1
            D  NaN   1   1   1   1
</code></pre></div>
<p dir="auto">Finally setting <code class="notranslate">na_values=[], keep_default_na=False</code> seems to fix the issue:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [14]: pd.read_csv(&quot;/home/alex/nan_issue.csv&quot;, na_filter=False,index_col=[0,1,2],na_values=[], keep_default_na=False)
Out[14]: 
                   d1  d2  d3  d4
u1          u2 u3                
Good Things C       1   1   1   1
            R       1   1   1   1
Bad Things  C       1   1   1   1
            T       1   1   1   1
Okay Things N  B    1   1   1   1
               D    1   1   1   1
            B       1   1   1   1
            D       1   1   1   1"><pre class="notranslate"><code class="notranslate">In [14]: pd.read_csv("/home/alex/nan_issue.csv", na_filter=False,index_col=[0,1,2],na_values=[], keep_default_na=False)
Out[14]: 
                   d1  d2  d3  d4
u1          u2 u3                
Good Things C       1   1   1   1
            R       1   1   1   1
Bad Things  C       1   1   1   1
            T       1   1   1   1
Okay Things N  B    1   1   1   1
               D    1   1   1   1
            B       1   1   1   1
            D       1   1   1   1
</code></pre></div>