<p dir="auto">When creating a daterange with a decimal number of minutes, pandas truncates everything before the decimal point. This leads to odd results e.g. if you're expecting to generate something every half minute and instead end up with something every 5 minutes, and even odder results if you have a float that is a whole number.</p>
<p dir="auto">A less contrived example is if pandas is used to process the results of some API call where you don't know what unit you'll have to go to to get to a whole number. It would be safe, I guess, to convert everything to nanoseconds, but not especially readable.</p>
<h4 dir="auto">A small, complete example of the issue</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; import pandas as pd
&gt;&gt;&gt; pd.date_range(end='2016-10-07T21:08:58.490180', periods=3, freq='0.5min')
DatetimeIndex(['2016-10-07 20:58:58.490180', '2016-10-07 21:03:58.490180',
               '2016-10-07 21:08:58.490180'],
              dtype='datetime64[ns]', freq='5T')
&gt;&gt;&gt; pd.date_range(end='2016-10-07T21:08:58.490180', periods=3, freq='10080.0min')
DatetimeIndex([], dtype='datetime64[ns]', freq='0T')"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</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-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">pd</span>.<span class="pl-en">date_range</span>(<span class="pl-s1">end</span><span class="pl-c1">=</span><span class="pl-s">'2016-10-07T21:08:58.490180'</span>, <span class="pl-s1">periods</span><span class="pl-c1">=</span><span class="pl-c1">3</span>, <span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-s">'0.5min'</span>)
<span class="pl-v">DatetimeIndex</span>([<span class="pl-s">'2016-10-07 20:58:58.490180'</span>, <span class="pl-s">'2016-10-07 21:03:58.490180'</span>,
               <span class="pl-s">'2016-10-07 21:08:58.490180'</span>],
              <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s">'datetime64[ns]'</span>, <span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-s">'5T'</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">pd</span>.<span class="pl-en">date_range</span>(<span class="pl-s1">end</span><span class="pl-c1">=</span><span class="pl-s">'2016-10-07T21:08:58.490180'</span>, <span class="pl-s1">periods</span><span class="pl-c1">=</span><span class="pl-c1">3</span>, <span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-s">'10080.0min'</span>)
<span class="pl-v">DatetimeIndex</span>([], <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s">'datetime64[ns]'</span>, <span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-s">'0T'</span>)</pre></div>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">For the first example:<br>
<code class="notranslate">DatetimeIndex(['2016-10-07 21:07:58.490180', '2016-10-07 21:08:28.490180', '2016-10-07 21:08:58.490180'], dtype='datetime64[ns]', freq='30S')</code></p>
<p dir="auto">For the second:<br>
<code class="notranslate">DatetimeIndex(['2016-09-23 21:08:58.490180', '2016-09-30 21:08:58.490180', '2016-10-07 21:08:58.490180'], dtype='datetime64[ns]', freq='10080T')</code></p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
## INSTALLED VERSIONS
<p dir="auto">commit: None<br>
python: 2.7.6.final.0<br>
python-bits: 64<br>
OS: Linux<br>
OS-release: 4.4.0-38-generic<br>
machine: x86_64<br>
processor: x86_64<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: en_US.UTF-8</p>
<p dir="auto">pandas: 0.18.1<br>
nose: 1.3.1<br>
pip: 1.5.4<br>
setuptools: 26.0.0<br>
Cython: None<br>
numpy: 1.11.1<br>
scipy: 0.17.1<br>
statsmodels: None<br>
xarray: None<br>
IPython: 5.1.0<br>
sphinx: None<br>
patsy: None<br>
dateutil: 2.5.3<br>
pytz: 2016.4<br>
blosc: None<br>
bottleneck: None<br>
tables: None<br>
numexpr: None<br>
matplotlib: 1.3.1<br>
openpyxl: None<br>
xlrd: None<br>
xlwt: None<br>
xlsxwriter: None<br>
lxml: None<br>
bs4: None<br>
html5lib: 0.999<br>
httplib2: 0.9.2<br>
apiclient: None<br>
sqlalchemy: 1.0.15<br>
pymysql: None<br>
psycopg2: 2.6.2 (dt dec pq3 ext lo64)<br>
jinja2: 2.8<br>
boto: 2.41.0<br>
pandas_datareader: None</p>
</details>
<p dir="auto">I'm new to pandas, so maybe I'm missing something, but I'd expected freq='.5s' to give me 500ms intervals, not 5s intervals:</p>
<blockquote>
<blockquote>
<blockquote>
<p dir="auto">pd.date_range(0, periods=5, freq='.5s')[1]<br>
Timestamp('1970-01-01 00:00:05', offset='5S')<br>
pd.date_range(0, periods=5, freq='500ms')[1]<br>
Timestamp('1970-01-01 00:00:00.500000', offset='500L')<br>
pd.<strong>version</strong><br>
'0.14.1'<br>
import sys; sys.version<br>
'3.4.1 (default, Jul  6 2014, 20:01:46) \n[GCC 4.9.0]'</p>
</blockquote>
</blockquote>
</blockquote>
<p dir="auto">Behaviour is the same under Python 2 and 3.</p>