A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/29 below:

.asfreq() dies when the index values have tzinfo associated with them · Issue #29 · pandas-dev/pandas · GitHub

>>> # dataframe is indexed at a second granularity, using eastern time
>>> dataframe                                                                   <class 'pandas.core.frame.DataFrame'>
Index: 24676 entries , 2010-10-04 00:03:49-04:00 to 2010-10-04 23:59:55-04:00
etf               10897  non-null values
etfvol            10897  non-null values
fut               17988  non-null values
futvol            17988  non-null values
ticx              7880  non-null values
vix               7465  non-null values
vixvol            7465  non-null values

>>> dataframe['etf'].index[0]
datetime.datetime(2010, 10, 4, 0, 3, 49, tzinfo=<DstTzInfo 'US/Eastern' EDT-1 day, 20:00:00 DST>)
>>>
>>> # et is a pytz timezone object for eastern time...
>>> et
<DstTzInfo 'US/Eastern' EST-1 day, 19:00:00 STD>

>>> dataframe['fut'].asfreq(et.localize(pn.DateOffset(seconds=1)), method='pad')
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/pytz-2010o-py2.5.egg/pytz/tzinfo.py", line 262, in localize
    if dt.tzinfo is not None:
AttributeError: 'DateOffset' object has no attribute 'tzinfo'
>>>
>>> dataframe['fut'].asfreq(pn.DateOffset(seconds=1), method='pad')             Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/pandas/core/series.py", line 1103, in asfreq
    dateRange = DateRange(self.index[0], self.index[-1], offset=freq)
  File "/usr/lib/python2.5/site-packages/pandas/core/daterange.py", line 70, in __new__
    fromInside = start is not None and start > _CACHE_START
TypeError: can't compare offset-naive and offset-aware datetimes
>>>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4