added line to whatsnew v0.19.2 and test to test_missing.py in series folder

This commit is contained in:
Rodolfo Fernandez 2016-12-17 21:59:31 -08:00
parent e4ba7e0f02
commit e0c6c7c629
3 changed files with 22 additions and 34 deletions

View File

@ -38,6 +38,7 @@ Other Enhancements
Bug Fixes
~~~~~~~~~
- Bug in fillna() in which timezone aware datetime64 values were incorrectly rounded (:issue:'14872')
- Compat with ``dateutil==2.6.0``; segfault reported in the testing suite (:issue:`14621`)
- Allow ``nanoseconds`` in ``Timestamp.replace`` as a kwarg (:issue:`14621`)
- Bug in ``pd.read_csv`` in which aliasing was being done for ``na_values`` when passed in as a dictionary (:issue:`14203`)

View File

@ -17,6 +17,9 @@ import pandas.util.testing as tm
from .common import TestData
import datetime
import pytz
def _skip_if_no_pchip():
try:
@ -908,6 +911,24 @@ class TestSeriesInterpolateData(TestData, tm.TestCase):
index=pd.to_timedelta([1, 2, 4]))
assert_series_equal(result, expected)
# GH 14872
def test_dtype_utc():
data = pd.Series([pd.NaT, pd.NaT,
datetime.datetime(2016, 12, 12, 22, 24, 6, 100001,
tzinfo=pytz.utc)])
filled = data.fillna(method='bfill')
expected = pd.Series([
datetime.datetime(2016, 12, 12, 22, 24, 6,
100001, tzinfo=pytz.utc),
datetime.datetime(2016, 12, 12, 22, 24, 6,
100001, tzinfo=pytz.utc),
datetime.datetime(2016, 12, 12, 22, 24, 6,
100001, tzinfo=pytz.utc)])
assert_series_equal(filled, expected)
if __name__ == '__main__':
import nose

View File

@ -1,34 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Dec 17 09:34:47 2016
@author: rodolfoxps
"""
import nose
import pandas as pd
import datetime
import pytz
from pandas.util.testing import assert_series_equal
def test_dtype_utc():
data = pd.Series([pd.NaT, pd.NaT,
datetime.datetime(2016, 12, 12, 22, 24, 6, 100001,
tzinfo=pytz.utc)])
filled = data.fillna(method='bfill')
expected = pd.Series([datetime.datetime(2016, 12, 12, 22, 24, 6, 100001,
tzinfo=pytz.utc),
datetime.datetime(2016, 12, 12, 22, 24, 6, 100001,
tzinfo=pytz.utc),
datetime.datetime(2016, 12, 12, 22, 24, 6, 100001,
tzinfo=pytz.utc)])
assert_series_equal(filled, expected)
if __name__ == '__main__':
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
exit=False)