Changeset 1169
- Timestamp:
- 07/29/08 19:51:12 (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/timeseries/scikits/timeseries/tests/test_timeseries.py
r1166 r1169 600 600 assert_equal(test1D._series.shape, newshape) 601 601 assert_equal(test1D._dates.shape, newshape) 602 # Using multiple args 603 test1D = series1D.reshape(*newshape) 604 assert_equal(test1D.shape, newshape) 605 602 606 # 603 607 def test_reshaping_2D(self): trunk/timeseries/scikits/timeseries/tseries.py
r1166 r1169 739 739 740 740 741 def reshape(self, newshape):742 """ a.reshape(shape, order='C')741 def reshape(self, *newshape, **kwargs): 742 """ 743 743 744 744 Returns a time series containing the data of a, but with a new shape. 745 746 745 The result is a view to the original array; if this is not possible, 747 746 a ValueError is raised. … … 761 760 A new view to the timeseries. 762 761 762 Warnings 763 -------- 764 The `._dates` part is reshaped, but the order is NOT ensured. 765 763 766 """ 764 767 # 1D series : reshape the dates as well 765 768 if not self._varshape: 766 result = MaskedArray.reshape(self, newshape) 767 result._dates = self._dates.reshape(newshape) 769 kwargs.update(order=kwargs.get('order','C')) 770 result = MaskedArray.reshape(self, *newshape, **kwargs) 771 result._dates = ndarray.reshape(self._dates, *newshape, **kwargs) 768 772 # nV/nD series: raise an exception for now ( 769 773 else:
