From f56a7ff4099ea4acfec7c3cb61b7bb11dd0ffe1d Mon Sep 17 00:00:00 2001 From: John Date: Sun, 25 Dec 2016 21:57:21 -0500 Subject: [PATCH] CLN: used np.__version__ and removed instantiation @rkern and others [recommend](http://stackoverflow.com/questions/1520234/how-to-check-which-version-of-numpy-im-using) using `np.__version__` instead of `np.version`. However I realize this is pandas "internals" so there may be some reason for using `np.version` over `np.__version__`. I could not find any such reason. I also removed a duplicate `LooseVersion(_np_version)` and reused the existing `_nlv` instance. --- pandas/compat/numpy/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/compat/numpy/__init__.py b/pandas/compat/numpy/__init__.py index f2d837a4c9908..358ac3c30b8e7 100644 --- a/pandas/compat/numpy/__init__.py +++ b/pandas/compat/numpy/__init__.py @@ -7,7 +7,7 @@ # numpy versioning -_np_version = np.version.short_version +_np_version = np.__version__ _nlv = LooseVersion(_np_version) _np_version_under1p8 = _nlv < '1.8' _np_version_under1p9 = _nlv < '1.9' @@ -15,7 +15,7 @@ _np_version_under1p11 = _nlv < '1.11' _np_version_under1p12 = _nlv < '1.12' -if LooseVersion(_np_version) < '1.7.0': +if _nlv < '1.7.0': raise ImportError('this version of pandas is incompatible with ' 'numpy < 1.7.0\n' 'your numpy version is {0}.\n'