<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="from pandas.compat import StringIO
import pandas as pd

t1 = &quot;&quot;&quot;float
1
&quot;&quot;&quot;
t2 = &quot;&quot;&quot;float
NaN
&quot;&quot;&quot;

for t in t1, t2:
    df = pd.read_csv(StringIO(t), dtype={'float': 'str'})
    print(type(df['float'][0]))"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">pandas</span>.<span class="pl-s1">compat</span> <span class="pl-k">import</span> <span class="pl-v">StringIO</span>
<span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>

<span class="pl-s1">t1</span> <span class="pl-c1">=</span> <span class="pl-s">"""float</span>
<span class="pl-s">1</span>
<span class="pl-s">"""</span>
<span class="pl-s1">t2</span> <span class="pl-c1">=</span> <span class="pl-s">"""float</span>
<span class="pl-s">NaN</span>
<span class="pl-s">"""</span>

<span class="pl-k">for</span> <span class="pl-s1">t</span> <span class="pl-c1">in</span> <span class="pl-s1">t1</span>, <span class="pl-s1">t2</span>:
    <span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">read_csv</span>(<span class="pl-v">StringIO</span>(<span class="pl-s1">t</span>), <span class="pl-s1">dtype</span><span class="pl-c1">=</span>{<span class="pl-s">'float'</span>: <span class="pl-s">'str'</span>})
    <span class="pl-en">print</span>(<span class="pl-en">type</span>(<span class="pl-s1">df</span>[<span class="pl-s">'float'</span>][<span class="pl-c1">0</span>]))</pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">Even when explicitly specifying <code class="notranslate">dtype</code> above, <code class="notranslate">read_csv</code> still converts values in the <code class="notranslate">float</code> column to a float when the string is "NaN". This behavior appears to be limited to "NaN" as it doesn't happen for regular numbers. Still, I unexpectedly ran across a "NaN" string in my application so it's blocking me.</p>
<p dir="auto">From <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="96377455" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/10647" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/10647/hovercard?comment_id=123715600&amp;comment_type=issue_comment" href="https://github.com/pandas-dev/pandas/issues/10647#issuecomment-123715600">#10647 (comment)</a></p>
<p dir="auto">In context of discussion on the default parsing of 'NA' in a csv file as NaN, I don't think we can change the default of parsing <code class="notranslate">NA</code>, but we <em>may consider</em> parsing of <code class="notranslate">"NA"</code> as a string instead of NaN:</p>
<blockquote>
<p dir="auto">Another change that we would maybe be more likely to consider, is the parsing of quoted values of NA (so only changing "NA" not be converted automatically, but leaving NA and alike converted to NaN as it is now).<br>
Personally, I would even this consider as a bug that it treats "NA" and NA the same, as I would expect that quoted values should be left untouched. But I don't know how long this behaviour has been this way.</p>
</blockquote>
<p dir="auto">Although I am not sure how invasive such a change would be, and difficult to assess, so maybe this is not worth risking many breakages?</p>