Skip to content

Instantly share code, notes, and snippets.

@phobson
Created November 8, 2012 20:02
Show Gist options
  • Save phobson/4041176 to your computer and use it in GitHub Desktop.
Save phobson/4041176 to your computer and use it in GitHub Desktop.
Twinx/Pandas dev error
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-1-27f6bdaefe81> in <module>()
31
32 raints.plot(ax=ax3, alpha=0.5, lw=1, color='b')
---> 33 gwets.plot(ax=ax3, kind='line', lw=2)
34 ax3.set_title('Rain and GWE on one axes')
35
c:\Python27\lib\site-packages\pandas\tools\plotting.pyc in plot_frame(frame, x, y, subplots, sharex, sharey, use_index, figsize, grid, legend, rot, ax, style, title, xlim, ylim, logy, xticks, yticks, kind, sort_columns, fontsize, secondary_y, **kwds)
1284 sort_columns=sort_columns, secondary_y=secondary_y,
1285 **kwds)
-> 1286 plot_obj.generate()
1287 plot_obj.draw()
1288 if subplots:
c:\Python27\lib\site-packages\pandas\tools\plotting.pyc in generate(self)
588 self._compute_plot_data()
589 self._setup_subplots()
--> 590 self._make_plot()
591 self._post_plot_logic()
592 self._adorn_subplots()
c:\Python27\lib\site-packages\pandas\tools\plotting.pyc in _make_plot(self)
916 # this is slightly deceptive
917 if self.use_index and self._use_dynamic_x():
--> 918 data = self._maybe_convert_index(self.data)
919 self._make_ts_plot(data, **self.kwds)
920 else:
c:\Python27\lib\site-packages\pandas\tools\plotting.pyc in _maybe_convert_index(self, data)
1043 if isinstance(freq, DateOffset):
1044 freq = freq.rule_code
-> 1045 freq = get_base_alias(freq)
1046 freq = get_period_alias(freq)
1047
c:\Python27\lib\site-packages\pandas\tseries\frequencies.pyc in get_base_alias(freqstr)
445 Returns the base frequency alias, e.g., '5D' -> 'D'
446 """
--> 447 return _base_and_stride(freqstr)[0]
448
449 _dont_uppercase = ['MS', 'ms']
c:\Python27\lib\site-packages\pandas\tseries\frequencies.pyc in _base_and_stride(freqstr)
424 _freq_and_stride('5Min') -> 'Min', 5
425 """
--> 426 groups = opattern.match(freqstr)
427
428 if not groups:
TypeError: expected string or buffer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment