Changeset 1056

Show
Ignore:
Timestamp:
06/23/08 19:10:43 (2 months ago)
Author:
mattknox_ca
Message:

fixed setitem behaviour for date strings

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/timeseries/scikits/timeseries/tseries.py

    r1053 r1056  
    574574                              self._slicebound_checker(indx.stop), 
    575575                              indx.step) 
    576             # Or maybe a field ? 
    577             elif isinstance(indx, basestring) and indx in self.dtype.names: 
     576            # Or maybe a field? 
     577            elif isinstance(indx, basestring) and \ 
     578              self.dtype.names is not None and indx in self.dtype.names: 
    578579                sindx = indx 
     580            # or string representation of a Date? 
     581            elif isinstance(indx, basestring): 
     582                _date = Date(freq=self.freq, string=indx) 
     583                _dates = ndarray.__getattribute__(self, '_dates') 
     584                sindx = _dates.date_to_index(_date) 
    579585            # Or some kind of date... 
    580586            else: