<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="&gt;&gt;&gt; index = pandas.to_timedelta([15e-7], unit=&quot;s&quot;)
&gt;&gt;&gt; index[0].nanoseconds
0
&gt;&gt;&gt; index[0].microseconds
2"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">index</span> <span class="pl-c1">=</span> <span class="pl-s1">pandas</span>.<span class="pl-en">to_timedelta</span>([<span class="pl-c1">15e-7</span>], <span class="pl-s1">unit</span><span class="pl-c1">=</span><span class="pl-s">"s"</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">index</span>[<span class="pl-c1">0</span>].<span class="pl-s1">nanoseconds</span>
<span class="pl-c1">0</span>
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">index</span>[<span class="pl-c1">0</span>].<span class="pl-s1">microseconds</span>
<span class="pl-c1">2</span></pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">nanoseconds range input for to_timedelta function are rounded to microseconds.</p>
<h4 dir="auto">Expected Output</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; index = pandas.to_timedelta([15e-7], unit=&quot;s&quot;)
&gt;&gt;&gt; index[0].nanoseconds
500
&gt;&gt;&gt; index[0].microseconds
1"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">index</span> <span class="pl-c1">=</span> <span class="pl-s1">pandas</span>.<span class="pl-en">to_timedelta</span>([<span class="pl-c1">15e-7</span>], <span class="pl-s1">unit</span><span class="pl-c1">=</span><span class="pl-s">"s"</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">index</span>[<span class="pl-c1">0</span>].<span class="pl-s1">nanoseconds</span>
<span class="pl-c1">500</span>
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">index</span>[<span class="pl-c1">0</span>].<span class="pl-s1">microseconds</span>
<span class="pl-c1">1</span></pre></div>
<p dir="auto">However this works fine:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; index = pandas.to_timedelta([1.5], unit=&quot;us&quot;)
&gt;&gt;&gt; index[0].nanoseconds
500
&gt;&gt;&gt; index[0].microseconds
1"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">index</span> <span class="pl-c1">=</span> <span class="pl-s1">pandas</span>.<span class="pl-en">to_timedelta</span>([<span class="pl-c1">1.5</span>], <span class="pl-s1">unit</span><span class="pl-c1">=</span><span class="pl-s">"us"</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">index</span>[<span class="pl-c1">0</span>].<span class="pl-s1">nanoseconds</span>
<span class="pl-c1">500</span>
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">index</span>[<span class="pl-c1">0</span>].<span class="pl-s1">microseconds</span>
<span class="pl-c1">1</span></pre></div>
<p dir="auto">So it seems to be something when se choose unit="s"</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.3.final.0<br>
python-bits: 64<br>
OS: Windows<br>
OS-release: 10<br>
machine: AMD64<br>
processor: Intel64 Family 6 Model 158 Stepping 9, GenuineIntel<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: None<br>
LOCALE: None.None<br>
pandas: 0.21.1<br>
pytest: 3.4.0<br>
pip: 9.0.1<br>
setuptools: 38.4.0<br>
Cython: 0.27.3<br>
numpy: 1.13.3<br>
scipy: 1.0.0<br>
pyarrow: None<br>
xarray: None<br>
IPython: 6.2.1<br>
sphinx: 1.6.6<br>
patsy: None<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.1.1<br>
openpyxl: 1.7.0<br>
xlrd: None<br>
xlwt: None<br>
xlsxwriter: None<br>
lxml: None<br>
bs4: None<br>
html5lib: 1.0.1<br>
sqlalchemy: None<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.10<br>
s3fs: None<br>
fastparquet: None<br>
pandas_gbq: None<br>
pandas_datareader: None</p>
</details>
<p dir="auto">I think this is rounding prematurely, though not entirely sure. Could also just be loss of precision when converting from a float -&gt; int64.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [12]: pd.to_datetime(1434743731.8770001,unit='s')
Out[12]: Timestamp('2015-06-19 19:55:31.877000')

In [13]: pd.to_datetime(1434743731.8770001,unit='s').value
Out[13]: 1434743731877000000

In [14]: (pd.Timestamp('2015-06-19 19:55:15.877000')+pd.Timedelta('1us')).value
Out[14]: 1434743715877001000
"><pre class="notranslate"><code class="notranslate">In [12]: pd.to_datetime(1434743731.8770001,unit='s')
Out[12]: Timestamp('2015-06-19 19:55:31.877000')

In [13]: pd.to_datetime(1434743731.8770001,unit='s').value
Out[13]: 1434743731877000000

In [14]: (pd.Timestamp('2015-06-19 19:55:15.877000')+pd.Timedelta('1us')).value
Out[14]: 1434743715877001000

</code></pre></div>