title: Pandas cannot plot timeseries imported from Excel
body: <p>This is my DataFrame obtained importing from an Excel .xls</p>
  
  <pre><code>    0   1
  664     2017-12-07 19:08:54     1.1377
  665     2017-12-07 19:10:31     1.1374
  666     2017-12-07 19:12:17     1.1377
  667     2017-12-07 19:13:28     1.1377
  668     2017-12-07 19:15:25     1.1379
  </code></pre>
  
  <p>I think is correclty typed</p>
  
  <pre><code>0    datetime64[ns]
  1           float64
  dtype: object
  </code></pre>
  
  <p>However it does not plot with <code>ax = _df.plot()</code> because of some error. Any idea why?
  This is my first hour in Pandas, sorry if it's classic question, but I saw only not relevant answers on this <code>ValueError: ordinal must be &gt;= 1</code></p>
  
  <p>Thanks for your inputs </p>
  
  <pre><code>---------------------------------------------------------------------------
  ValueError                                Traceback (most recent call last)
  &lt;ipython-input-24-ca306a836171&gt; in &lt;module&gt;()
  ----&gt; 1 ax = _df.plot()
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/plotting/_core.py in __call__(self, x, y, kind, ax, subplots, sharex, sharey, layout, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, secondary_y, sort_columns, **kwds)
     2671                           fontsize=fontsize, colormap=colormap, table=table,
     2672                           yerr=yerr, xerr=xerr, secondary_y=secondary_y,
  -&gt; 2673                           sort_columns=sort_columns, **kwds)
     2674     __call__.__doc__ = plot_frame.__doc__
     2675 
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/plotting/_core.py in plot_frame(data, x, y, kind, ax, subplots, sharex, sharey, layout, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, secondary_y, sort_columns, **kwds)
     1898                  yerr=yerr, xerr=xerr,
     1899                  secondary_y=secondary_y, sort_columns=sort_columns,
  -&gt; 1900                  **kwds)
     1901 
     1902 
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/plotting/_core.py in _plot(data, x, y, subplots, ax, kind, **kwds)
     1725         plot_obj = klass(data, subplots=subplots, ax=ax, kind=kind, **kwds)
     1726 
  -&gt; 1727     plot_obj.generate()
     1728     plot_obj.draw()
     1729     return plot_obj.result
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/plotting/_core.py in generate(self)
      258 
      259         for ax in self.axes:
  --&gt; 260             self._post_plot_logic_common(ax, self.data)
      261             self._post_plot_logic(ax, self.data)
      262 
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/plotting/_core.py in _post_plot_logic_common(self, ax, data)
      393             self._apply_axis_properties(ax.xaxis, rot=self.rot,
      394                                         fontsize=self.fontsize)
  --&gt; 395             self._apply_axis_properties(ax.yaxis, fontsize=self.fontsize)
      396 
      397             if hasattr(ax, 'right_ax'):
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/plotting/_core.py in _apply_axis_properties(self, axis, rot, fontsize)
      466 
      467     def _apply_axis_properties(self, axis, rot=None, fontsize=None):
  --&gt; 468         labels = axis.get_majorticklabels() + axis.get_minorticklabels()
      469         for label in labels:
      470             if rot is not None:
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/axis.py in get_majorticklabels(self)
     1189     def get_majorticklabels(self):
     1190         'Return a list of Text instances for the major ticklabels'
  -&gt; 1191         ticks = self.get_major_ticks()
     1192         labels1 = [tick.label1 for tick in ticks if tick.label1On]
     1193         labels2 = [tick.label2 for tick in ticks if tick.label2On]
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/axis.py in get_major_ticks(self, numticks)
     1318         'get the tick instances; grow as necessary'
     1319         if numticks is None:
  -&gt; 1320             numticks = len(self.get_major_locator()())
     1321         if len(self.majorTicks) &lt; numticks:
     1322             # update the new tick label properties from the old
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/dates.py in __call__(self)
      984     def __call__(self):
      985         'Return the locations of the ticks'
  --&gt; 986         self.refresh()
      987         return self._locator()
      988 
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/dates.py in refresh(self)
     1004     def refresh(self):
     1005         'Refresh internal information based on current limits.'
  -&gt; 1006         dmin, dmax = self.viewlim_to_dt()
     1007         self._locator = self.get_locator(dmin, dmax)
     1008 
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/dates.py in viewlim_to_dt(self)
      761             vmin, vmax = vmax, vmin
      762 
  --&gt; 763         return num2date(vmin, self.tz), num2date(vmax, self.tz)
      764 
      765     def _get_unit(self):
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/dates.py in num2date(x, tz)
      399         tz = _get_rc_timezone()
      400     if not cbook.iterable(x):
  --&gt; 401         return _from_ordinalf(x, tz)
      402     else:
      403         x = np.asarray(x)
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/dates.py in _from_ordinalf(x, tz)
      252 
      253     ix = int(x)
  --&gt; 254     dt = datetime.datetime.fromordinal(ix).replace(tzinfo=UTC)
      255 
      256     remainder = float(x) - ix
  
  ValueError: ordinal must be &gt;= 1
  
  ---------------------------------------------------------------------------
  ValueError                                Traceback (most recent call last)
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/IPython/core/formatters.py in __call__(self, obj)
      330                 pass
      331             else:
  --&gt; 332                 return printer(obj)
      333             # Finally look for special method names
      334             method = get_real_method(obj, self.print_method)
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/IPython/core/pylabtools.py in &lt;lambda&gt;(fig)
      235 
      236     if 'png' in formats:
  --&gt; 237         png_formatter.for_type(Figure, lambda fig: print_figure(fig, 'png', **kwargs))
      238     if 'retina' in formats or 'png2x' in formats:
      239         png_formatter.for_type(Figure, lambda fig: retina_figure(fig, **kwargs))
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/IPython/core/pylabtools.py in print_figure(fig, fmt, bbox_inches, **kwargs)
      119 
      120     bytes_io = BytesIO()
  --&gt; 121     fig.canvas.print_figure(bytes_io, **kw)
      122     data = bytes_io.getvalue()
      123     if fmt == 'svg':
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/backend_bases.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, **kwargs)
     2198                     orientation=orientation,
     2199                     dryrun=True,
  -&gt; 2200                     **kwargs)
     2201                 renderer = self.figure._cachedRenderer
     2202                 bbox_inches = self.figure.get_tightbbox(renderer)
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py in print_png(self, filename_or_obj, *args, **kwargs)
      543 
      544     def print_png(self, filename_or_obj, *args, **kwargs):
  --&gt; 545         FigureCanvasAgg.draw(self)
      546         renderer = self.get_renderer()
      547         original_dpi = renderer.dpi
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py in draw(self)
      462 
      463         try:
  --&gt; 464             self.figure.draw(self.renderer)
      465         finally:
      466             RendererAgg.lock.release()
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
       61     def draw_wrapper(artist, renderer, *args, **kwargs):
       62         before(artist, renderer)
  ---&gt; 63         draw(artist, renderer, *args, **kwargs)
       64         after(artist, renderer)
       65 
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/figure.py in draw(self, renderer)
     1142 
     1143             mimage._draw_list_compositing_images(
  -&gt; 1144                 renderer, self, dsu, self.suppressComposite)
     1145 
     1146             renderer.close_group('figure')
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/image.py in _draw_list_compositing_images(renderer, parent, dsu, suppress_composite)
      137     if not_composite or not has_images:
      138         for zorder, a in dsu:
  --&gt; 139             a.draw(renderer)
      140     else:
      141         # Composite any adjacent images together
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
       61     def draw_wrapper(artist, renderer, *args, **kwargs):
       62         before(artist, renderer)
  ---&gt; 63         draw(artist, renderer, *args, **kwargs)
       64         after(artist, renderer)
       65 
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/axes/_base.py in draw(self, renderer, inframe)
     2424             renderer.stop_rasterizing()
     2425 
  -&gt; 2426         mimage._draw_list_compositing_images(renderer, self, dsu)
     2427 
     2428         renderer.close_group('axes')
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/image.py in _draw_list_compositing_images(renderer, parent, dsu, suppress_composite)
      137     if not_composite or not has_images:
      138         for zorder, a in dsu:
  --&gt; 139             a.draw(renderer)
      140     else:
      141         # Composite any adjacent images together
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
       61     def draw_wrapper(artist, renderer, *args, **kwargs):
       62         before(artist, renderer)
  ---&gt; 63         draw(artist, renderer, *args, **kwargs)
       64         after(artist, renderer)
       65 
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/axis.py in draw(self, renderer, *args, **kwargs)
     1134         renderer.open_group(__name__)
     1135 
  -&gt; 1136         ticks_to_draw = self._update_ticks(renderer)
     1137         ticklabelBoxes, ticklabelBoxes2 = self._get_tick_bboxes(ticks_to_draw,
     1138                                                                 renderer)
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/axis.py in _update_ticks(self, renderer)
      967 
      968         interval = self.get_view_interval()
  --&gt; 969         tick_tups = [t for t in self.iter_ticks()]
      970         if self._smart_bounds:
      971             # handle inverted limits
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/axis.py in &lt;listcomp&gt;(.0)
      967 
      968         interval = self.get_view_interval()
  --&gt; 969         tick_tups = [t for t in self.iter_ticks()]
      970         if self._smart_bounds:
      971             # handle inverted limits
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/axis.py in iter_ticks(self)
      910         Iterate through all of the major and minor ticks.
      911         """
  --&gt; 912         majorLocs = self.major.locator()
      913         majorTicks = self.get_major_ticks(len(majorLocs))
      914         self.major.formatter.set_locs(majorLocs)
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/dates.py in __call__(self)
      984     def __call__(self):
      985         'Return the locations of the ticks'
  --&gt; 986         self.refresh()
      987         return self._locator()
      988 
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/dates.py in refresh(self)
     1004     def refresh(self):
     1005         'Refresh internal information based on current limits.'
  -&gt; 1006         dmin, dmax = self.viewlim_to_dt()
     1007         self._locator = self.get_locator(dmin, dmax)
     1008 
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/dates.py in viewlim_to_dt(self)
      761             vmin, vmax = vmax, vmin
      762 
  --&gt; 763         return num2date(vmin, self.tz), num2date(vmax, self.tz)
      764 
      765     def _get_unit(self):
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/dates.py in num2date(x, tz)
      399         tz = _get_rc_timezone()
      400     if not cbook.iterable(x):
  --&gt; 401         return _from_ordinalf(x, tz)
      402     else:
      403         x = np.asarray(x)
  
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/dates.py in _from_ordinalf(x, tz)
      252 
      253     ix = int(x)
  --&gt; 254     dt = datetime.datetime.fromordinal(ix).replace(tzinfo=UTC)
      255 
      256     remainder = float(x) - ix
  
  ValueError: ordinal must be &gt;= 1
  
  &lt;matplotlib.figure.Figure at 0x118f1e978&gt;
  </code></pre>