|
8 | 8 |
|
9 | 9 | import pandas.core.common as com
|
10 | 10 | import pandas.core.datetools as datetools
|
| 11 | +from pandas.util import py3compat |
11 | 12 |
|
12 | 13 | from pandas._tseries import Timestamp
|
13 | 14 | import pandas._tseries as lib
|
@@ -185,7 +186,7 @@ def asfreq(self, freq=None, how='E'):
|
185 | 186 | base2, mult2 = _gfc(freq)
|
186 | 187 |
|
187 | 188 | new_ordinal = lib.period_asfreq(self.ordinal, base1, mult1,
|
188 |
| - base2, mult2, how) |
| 189 | + base2, mult2, py3compat.str_to_bytes(how)) |
189 | 190 |
|
190 | 191 | return Period(new_ordinal, (base2, mult2))
|
191 | 192 |
|
@@ -514,7 +515,7 @@ def __new__(cls, data=None,
|
514 | 515 | base1, mult1 = _gfc(data.freq)
|
515 | 516 | base2, mult2 = _gfc(freq)
|
516 | 517 | data = lib.period_asfreq_arr(data.values, base1, mult1,
|
517 |
| - base2, mult2, 'E') |
| 518 | + base2, mult2, b'E') |
518 | 519 | else:
|
519 | 520 | if freq is None:
|
520 | 521 | raise ValueError('freq cannot be none')
|
@@ -558,7 +559,7 @@ def asfreq(self, freq=None, how='E'):
|
558 | 559 |
|
559 | 560 | new_data = lib.period_asfreq_arr(self.values,
|
560 | 561 | base1, mult1,
|
561 |
| - base2, mult2, how) |
| 562 | + base2, mult2, py3compat.str_to_bytes(how)) |
562 | 563 |
|
563 | 564 | return PeriodIndex(new_data, freq=freq)
|
564 | 565 |
|
|
0 commit comments