Skip to content

Commit a66543b

Browse files
committed
ENH: better repr for weekly Periods, close #1503
1 parent 5b277bd commit a66543b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

RELEASE.rst

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ pandas 0.8.1
5151
- Cleaner DatetimeIndex string representation with 1 or 2 elements (#1611)
5252
- Improve performance of array-of-Period to PeriodIndex, convert such arrays
5353
to PeriodIndex inside Index (#1215)
54+
- More informative string representation for weekly Period objects (#1503)
5455

5556
**Bug fixes**
5657

@@ -77,6 +78,7 @@ pandas 0.8.1
7778
- Fix DatetimeIndex intersection logic error with irregular indexes (#1551)
7879
- Fix unit test errors on Python 3 (#1550)
7980
- Fix .ix indexing bugs in duplicate DataFrame index (#1201)
81+
- Better handle errors with non-existing objects in HDFStore (#1254)
8082

8183
pandas 0.8.0
8284
============

pandas/src/plib.pyx

+6-2
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,12 @@ def period_format(int64_t value, int freq, object fmt=None):
231231
fmt = b'%FQ%q'
232232
elif freq_group == 3000: # FR_MTH
233233
fmt = b'%b-%Y'
234-
elif (freq_group == 4000 # WK
235-
or freq_group == 5000 # BUS
234+
elif freq_group == 4000: # WK
235+
left = period_asfreq(value, freq, 6000, 0)
236+
right = period_asfreq(value, freq, 6000, 1)
237+
return '%s/%s' % (period_format(left, 6000),
238+
period_format(right, 6000))
239+
elif (freq_group == 5000 # BUS
236240
or freq_group == 6000): # DAY
237241
fmt = b'%d-%b-%Y'
238242
elif freq_group == 7000: # HR

0 commit comments

Comments
 (0)