Skip to content

Exception during resample w/ tz #2245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
craustin opened this issue Nov 14, 2012 · 1 comment
Closed

Exception during resample w/ tz #2245

craustin opened this issue Nov 14, 2012 · 1 comment
Assignees
Labels
Bug Datetime Datetime data dtype
Milestone

Comments

@craustin
Copy link

from pandas import date_range, Series
idx = date_range('2001-09-20 15:59','2001-09-20 16:00', freq='T', tz='Australia/Sydney')
s = Series([1,2], index=idx)
s.resample('D')

In [4]: s.resample('D')

ValueError Traceback (most recent call last)
in ()
----> 1 s.resample('D')

Q:\GAARD\Prod\Apps\Pandas64\4.36\pandas\core\generic.pyc in resample(self, rule, how, axis, fill_method, closed,
label, convention, kind, loffset, limit, base)
187 fill_method=fill_method, convention=convention,
188 limit=limit, base=base)
--> 189 return sampler.resample(self)
190
191 def first(self, offset):

Q:\GAARD\Prod\Apps\Pandas64\4.36\pandas\tseries\resample.pyc in resample(self, obj)
66
67 if isinstance(axis, DatetimeIndex):
---> 68 rs = self._resample_timestamps(obj)
69 elif isinstance(axis, PeriodIndex):
70 offset = to_offset(self.freq)

Q:\GAARD\Prod\Apps\Pandas64\4.36\pandas\tseries\resample.pyc in _resample_timestamps(self, obj)
180 axlabels = obj._get_axis(self.axis)
181
--> 182 binner, grouper = self._get_time_grouper(obj)
183
184 # Determine if we're downsampling

Q:\GAARD\Prod\Apps\Pandas64\4.36\pandas\tseries\resample.pyc in _get_time_grouper(self, obj)
95
96 if self.kind is None or self.kind == 'timestamp':
---> 97 binner, bins, binlabels = self._get_time_bins(axis)
98 else:
99 binner, bins, binlabels = self._get_time_period_bins(axis)

Q:\GAARD\Prod\Apps\Pandas64\4.36\pandas\tseries\resample.pyc in _get_time_bins(self, axis)
125
126 # general version, knowing nothing about relative frequencies
--> 127 bins = lib.generate_bins_dt64(ax_values, bin_edges, self.closed)
128
129 if self.closed == 'right':

Q:\GAARD\Prod\Apps\Pandas64\4.36\pandas\lib.pyd in pandas.lib.generate_bins_dt64 (pandas\src\tseries.c:61444)()

ValueError: Values falls after last bin

@ghost ghost assigned wesm Nov 14, 2012
@wesm wesm closed this as completed in bd34795 Nov 14, 2012
yarikoptic added a commit to neurodebian/pandas that referenced this issue Nov 15, 2012
Version 0.9.1

* tag 'v0.9.1':
  RLS: Version 0.9.1 final
  BUG: icol() should propegate fill_value for sparse data frames pandas-dev#2249
  TST: icol() should propegate fill_value for sparse data frames
  BUG: override SparseDataFrame.icol to use __getitem__ instead of accessing _data internals. close pandas-dev#2251
  BUG: make Series.tz_localize work with length-0 non-DatetimeIndex. close pandas-dev#2248
  BUG: parallel_coordinates bugfix with matplotlib 1.2.0. close pandas-dev#2237
  BUG: issue constructing DataFrame from empty Series with name. close pandas-dev#2234
  ENH: disable repr dependence on terminal width when running non-interactively. pandas-dev#1610
  BUG: ExcelWriter raises exception on PeriodIndex pandas-dev#2240
  BUG: SparseDataFrame.icol return SparseSeries. SparseSeries.from_array return SparseSeries. close pandas-dev#2227, pandas-dev#2229
  BUG: fix tz-aware resampling issue. close pandas-dev#2245
@gbakalian
Copy link

Having a similar issue

idx = date_range('2014-10-08 00:00','2014-10-09 00:00', freq='D', tz='Europe/Berlin')
pd.Series(5, idx).resample('MS')

Crashed,

While if I remove the tz :

idx = date_range('2014-10-08 00:00','2014-10-09 00:00', freq='D')
pd.Series(5, idx).resample('MS')

that works perfectly

version : '0.15.0rc1'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype
Projects
None yet
Development

No branches or pull requests

3 participants