fixed style errors using flake8
This commit is contained in:
parent
59b91a1226
commit
19eecb280c
|
@ -7,21 +7,28 @@ Created on Sat Dec 17 09:34:47 2016
|
|||
"""
|
||||
import nose
|
||||
import pandas as pd
|
||||
import datetime, pytz
|
||||
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) ])
|
||||
|
||||
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)
|
||||
exit=False)
|
||||
|
|
|
@ -26,7 +26,8 @@ _NS_DTYPE_UTC = DatetimeTZDtype.__new__(DatetimeTZDtype, unit='ns', tz='UTC')
|
|||
|
||||
_DATELIKE_DTYPES = set([np.dtype(t)
|
||||
for t in ['M8[ns]', '<M8[ns]', '>M8[ns]',
|
||||
'm8[ns]', '<m8[ns]', '>m8[ns]']] + [_NS_DTYPE_UTC])
|
||||
'm8[ns]', '<m8[ns]', '>m8[ns]']] +
|
||||
[_NS_DTYPE_UTC])
|
||||
|
||||
_ensure_float64 = algos.ensure_float64
|
||||
_ensure_float32 = algos.ensure_float32
|
||||
|
|
Loading…
Reference in New Issue