Date range issue in pandas python
<p>I tried this: </p>

<pre><code>pd.date_range(2000, periods = 365, freq = 'D',format = '%d-%m-%Y')
</code></pre>

<p>why I am getting this result:</p>

<pre><code>DatetimeIndex(['1970-01-01 00:00:00.000002', '1970-01-02 00:00:00.000002',
               '1970-01-03 00:00:00.000002', '1970-01-04 00:00:00.000002',
               '1970-01-05 00:00:00.000002', '1970-01-06 00:00:00.000002',
               '1970-01-07 00:00:00.000002', '1970-01-08 00:00:00.000002',
</code></pre>

<p>Any help?</p>

<p>You need add <code>''</code> to <code>2000</code> only:</p>

<pre><code>print (pd.date_range('2000', periods = 365, freq = 'D'))

DatetimeIndex(['2000-01-01', '2000-01-02', '2000-01-03', '2000-01-04',
               '2000-01-05', '2000-01-06', '2000-01-07', '2000-01-08',
               '2000-01-09', '2000-01-10',
               ...
               '2000-12-21', '2000-12-22', '2000-12-23', '2000-12-24',
               '2000-12-25', '2000-12-26', '2000-12-27', '2000-12-28',
               '2000-12-29', '2000-12-30'],
              dtype='datetime64[ns]', length=365, freq='D')
</code></pre>

<p>If use <code>int</code>, cast it to <code>str</code>:</p>

<pre><code>print (pd.date_range(str(2000), periods = 365, freq = 'D'))
</code></pre>

python date pandas date-range datetimeindex