在Windows 10 64位上安装Python 3.6.2和Pandas后,我运行了描述here的测试。失败似乎主要与两个问题有关。
前3个错误与索引有关:
TypeError: '<' not supported between instances of 'str' and 'int'
AssertionError: "'>' not supported" does not match "'<' not supported between instances of 'str' and 'int'"
Failed: DID NOT RAISE <class 'IndexError'>
其余3个错误似乎是日期和时间问题:
def test_fallback_plural(self):
# test moving from daylight savings to standard time import dateutil
...
def _test_offset(self, offset_name, offset_n, tstart, expected_utc_offset):
...
AssertionError: assert -7.0 == -8
AssertionError: assert Timestamp('2013-10-27 01:00:00+0100', tz='dateutil/GB-Eire', freq='H') == Timestamp('2013-10-27 02:00:00+0100', tz='dateutil/GB-Eire', req='H')
+ where Timestamp('2013-10-27 02:00:00+0100', tz='dateutil/GB-Eire', freq='H') = Timestamp('2013-10-27 01:00:00+0000', tz='dateutil/Europe/London', freq='H')
def test_ambiguous_compat(self):
# validate that pytz and dateutil are compat for dst when the transition happens
...
assert (result_pytz.to_pydatetime().tzname() ==
result_dateutil.to_pydatetime().tzname())
AssertionError: assert 'GMT' == 'BST'
- GMT
+ BST
最后,我收到了以下警告摘要:
/Path/To/Tests/test_missing.py::test_array_equivalent_compat
/Path/To/nump/core/numeric.py:2604: FutureWarning: elementwise == comparison failed and returning scalar instead; this will raise an error or perform elementwise comparison in the future.
return bool(asarray(a1 == a2).all())
编辑1:
pd.show_versions()
INSTALLED VERSIONS
------------------
commit: None
python: 3.6.2.final.0
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 78 Stepping 3, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None
pandas: 0.20.3
pytest: 3.2.2
pip: 9.0.1
setuptools: 28.8.0
Cython: None
numpy: 1.13.3
scipy: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.6.1
pytz: 2017.2
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
s3fs: None
pandas_gbq: None
pandas_datareader: None
编辑2:
答案 0 :(得分:0)
我认为所有这些都应该在master /即将发布的(2017年10月)0.21.0
版本中修复。
日期时间是因为您使用的是dateutil
的最新版本,此处有一组修复:
https://github.com/pandas-dev/pandas/pull/16880
警告是一个已知问题,在此处关闭: https://github.com/pandas-dev/pandas/issues/17463
如果您尝试开发版本并且其中任何一个仍然存在,请在github repo上打开一个问题。 https://github.com/pandas-dev/pandas