|
9 | 9 |
|
10 | 10 | from datetime import datetime, date
|
11 | 11 |
|
12 |
| -from pandas import Series, DataFrame, MultiIndex, PeriodIndex, date_range |
| 12 | +from pandas import (Series, DataFrame, MultiIndex, PeriodIndex, date_range, |
| 13 | + bdate_range) |
13 | 14 | from pandas.compat import (range, lrange, StringIO, lmap, lzip, u, zip,
|
14 | 15 | iteritems, OrderedDict, PY3)
|
15 | 16 | from pandas.util.decorators import cache_readonly
|
@@ -1152,6 +1153,18 @@ def test_xcompat(self):
|
1152 | 1153 | self.assertNotIsInstance(lines[0].get_xdata(), PeriodIndex)
|
1153 | 1154 | self.assertIsInstance(PeriodIndex(lines[0].get_xdata()), PeriodIndex)
|
1154 | 1155 |
|
| 1156 | + def test_period_compat(self): |
| 1157 | + # GH 9012 |
| 1158 | + # period-array conversions |
| 1159 | + df = DataFrame( |
| 1160 | + np.random.rand(21, 2), |
| 1161 | + index=bdate_range(datetime(2000, 1, 1), datetime(2000, 1, 31)), |
| 1162 | + columns=['a', 'b']) |
| 1163 | + |
| 1164 | + df.plot() |
| 1165 | + self.plt.axhline(y=0) |
| 1166 | + tm.close() |
| 1167 | + |
1155 | 1168 | def test_unsorted_index(self):
|
1156 | 1169 | df = DataFrame({'y': np.arange(100)},
|
1157 | 1170 | index=np.arange(99, -1, -1), dtype=np.int64)
|
|
0 commit comments