Skip to content

BUG: Series.resample across daylight saving boundary causes segfault. #9468

Closed
@jeremywhelchel

Description

@jeremywhelchel

The following snippet of code is causing a segfault. Here it's failing at head, but I've seen it fail in the 0.15.2 release as well, with both NumPy 1.7.1 and NumPy 1.9.1.
Interestingly this doesn't happen with Pandas 0.13.1.

>>> import pandas
>>> import pytz
>>> pandas.show_versions()
INSTALLED VERSIONS
------------------
commit: None
python: 2.7.6.final.0
python-bits: 64
OS: Linux
OS-release: 3.16.0-30-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.15.2-182-gbb9c311
nose: None
Cython: 0.20.1post0
numpy: 1.9.1
scipy: None
statsmodels: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.4.0
pytz: 2013b
bottleneck: None
tables: None
numexpr: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
rpy2: None
sqlalchemy: None
pymysql: None
psycopg2: None
>>> LA_TZ = pytz.timezone('America/Los_Angeles')
>>> 
>>> s = pandas.Series({
...     pandas.Timestamp('2010-1-1', tz=LA_TZ): 1,
...     pandas.Timestamp('2011-4-1', tz=LA_TZ): 1})
>>> s
2010-01-01 00:00:00-08:00    1
2011-04-01 00:00:00-07:00    1
dtype: int64
>>> s.resample('D', how='max', fill_method='pad')
Segmentation fault (core dumped)

Other observations:

  • The start/end need to cross the daylight savings switch. Notice utc-08:00 vs utc-07:00 above
  • Only fails with how=max and fill_method=pad
  • Needs a large enough resampled window. 2011-1-1 to 2011-4-1 won't do it. But 2010-1-1 to 2011-4-1 will.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions