Skip to content

Instantly share code, notes, and snippets.

@andreabedini
Created July 22, 2015 03:05
Show Gist options
  • Select an option

  • Save andreabedini/074d529ff63356312ce6 to your computer and use it in GitHub Desktop.

Select an option

Save andreabedini/074d529ff63356312ce6 to your computer and use it in GitHub Desktop.
---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
<ipython-input-8-7369931b6968> in <module>()
2
3 index = pd.timedelta_range(start="06:00:01", end="12:00:00", freq='S')
----> 4 pd.Series(range(index.size), index=index).plot()
/usr/local/lib/python3.4/site-packages/pandas/tools/plotting.py in plot_series(data, kind, ax, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, label, secondary_y, **kwds)
2517 yerr=yerr, xerr=xerr,
2518 label=label, secondary_y=secondary_y,
-> 2519 **kwds)
2520
2521
/usr/local/lib/python3.4/site-packages/pandas/tools/plotting.py in _plot(data, x, y, subplots, ax, kind, **kwds)
2322 plot_obj = klass(data, subplots=subplots, ax=ax, kind=kind, **kwds)
2323
-> 2324 plot_obj.generate()
2325 plot_obj.draw()
2326 return plot_obj.result
/usr/local/lib/python3.4/site-packages/pandas/tools/plotting.py in generate(self)
916 self._make_legend()
917 self._post_plot_logic()
--> 918 self._adorn_subplots()
919
920 def _args_adjust(self):
/usr/local/lib/python3.4/site-packages/pandas/tools/plotting.py in _adorn_subplots(self)
1076 ax.set_xticklabels(xticklabels)
1077 self._apply_axis_properties(ax.xaxis, rot=self.rot,
-> 1078 fontsize=self.fontsize)
1079 self._apply_axis_properties(ax.yaxis, fontsize=self.fontsize)
1080 elif self.orientation == 'horizontal':
/usr/local/lib/python3.4/site-packages/pandas/tools/plotting.py in _apply_axis_properties(self, axis, rot, fontsize)
1087
1088 def _apply_axis_properties(self, axis, rot=None, fontsize=None):
-> 1089 labels = axis.get_majorticklabels() + axis.get_minorticklabels()
1090 for label in labels:
1091 if rot is not None:
/usr/local/lib/python3.4/site-packages/matplotlib/axis.py in get_majorticklabels(self)
1166 def get_majorticklabels(self):
1167 'Return a list of Text instances for the major ticklabels'
-> 1168 ticks = self.get_major_ticks()
1169 labels1 = [tick.label1 for tick in ticks if tick.label1On]
1170 labels2 = [tick.label2 for tick in ticks if tick.label2On]
/usr/local/lib/python3.4/site-packages/matplotlib/axis.py in get_major_ticks(self, numticks)
1295 'get the tick instances; grow as necessary'
1296 if numticks is None:
-> 1297 numticks = len(self.get_major_locator()())
1298 if len(self.majorTicks) < numticks:
1299 # update the new tick label properties from the old
/usr/local/lib/python3.4/site-packages/pandas/tseries/converter.py in __call__(self)
901 vmin, vmax = vmax, vmin
902 if self.isdynamic:
--> 903 locs = self._get_default_locs(vmin, vmax)
904 else: # pragma: no cover
905 base = self.base
/usr/local/lib/python3.4/site-packages/pandas/tseries/converter.py in _get_default_locs(self, vmin, vmax)
882
883 if self.plot_obj.date_axis_info is None:
--> 884 self.plot_obj.date_axis_info = self.finder(vmin, vmax, self.freq)
885
886 locator = self.plot_obj.date_axis_info
/usr/local/lib/python3.4/site-packages/pandas/tseries/converter.py in _daily_finder(vmin, vmax, freq)
505 Period(ordinal=int(vmax), freq=freq))
506 span = vmax.ordinal - vmin.ordinal + 1
--> 507 dates_ = PeriodIndex(start=vmin, end=vmax, freq=freq)
508 # Initialize the output
509 info = np.zeros(span,
/usr/local/lib/python3.4/site-packages/pandas/tseries/period.py in __new__(cls, data, ordinal, freq, start, end, periods, copy, name, tz, **kwargs)
175 else:
176 data, freq = cls._generate_range(start, end, periods,
--> 177 freq, kwargs)
178 else:
179 ordinal, freq = cls._from_arraylike(data, freq, tz)
/usr/local/lib/python3.4/site-packages/pandas/tseries/period.py in _generate_range(cls, start, end, periods, freq, fields)
189 raise ValueError('Can either instantiate from fields '
190 'or endpoints, but not both')
--> 191 subarr, freq = _get_ordinal_range(start, end, periods, freq)
192 elif field_count > 0:
193 subarr, freq = _range_from_fields(freq=freq, **fields)
/usr/local/lib/python3.4/site-packages/pandas/tseries/period.py in _get_ordinal_range(start, end, periods, freq)
910 dtype=np.int64)
911 else:
--> 912 data = np.arange(start.ordinal, end.ordinal + 1, dtype=np.int64)
913
914 return data, freq
MemoryError:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment