File tree 2 files changed +13
-2
lines changed
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -854,9 +854,11 @@ def _get_time_bins(self, ax):
854
854
closed = self .closed ,
855
855
base = self .base )
856
856
tz = ax .tz
857
+ # do not call replace() because that will swallow the nanosecond part
858
+ # GH #12037
857
859
binner = labels = DatetimeIndex (freq = self .freq ,
858
- start = first . replace ( tzinfo = None ) ,
859
- end = last . replace ( tzinfo = None ) ,
860
+ start = first ,
861
+ end = last ,
860
862
tz = tz ,
861
863
name = ax .name )
862
864
Original file line number Diff line number Diff line change @@ -1224,6 +1224,15 @@ def test_monthly_resample_error(self):
1224
1224
# it works!
1225
1225
ts .resample ('M' )
1226
1226
1227
+ def test_nanosecond_resample_error (self ):
1228
+ # GH 12307
1229
+ start = 1443707890427
1230
+ indx = pd .date_range (start = pd .to_datetime (start ),
1231
+ periods = 10 , freq = '100n' )
1232
+ ts = pd .Series (np .random .randn (len (indx )), index = indx )
1233
+ r = ts .resample (pd .tseries .offsets .Nano (100 ))
1234
+ r .agg ('mean' )
1235
+
1227
1236
def test_resample_anchored_intraday (self ):
1228
1237
# #1471, #1458
1229
1238
You can’t perform that action at this time.
0 commit comments