Skip to content

Commit 7a79c1a

Browse files
john-a-mjreback
authored andcommitted
CLN: used np.__version__ and removed instantiation (#14988)
@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.
1 parent bf7b529 commit 7a79c1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/compat/numpy/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77

88

99
# numpy versioning
10-
_np_version = np.version.short_version
10+
_np_version = np.__version__
1111
_nlv = LooseVersion(_np_version)
1212
_np_version_under1p8 = _nlv < '1.8'
1313
_np_version_under1p9 = _nlv < '1.9'
1414
_np_version_under1p10 = _nlv < '1.10'
1515
_np_version_under1p11 = _nlv < '1.11'
1616
_np_version_under1p12 = _nlv < '1.12'
1717

18-
if LooseVersion(_np_version) < '1.7.0':
18+
if _nlv < '1.7.0':
1919
raise ImportError('this version of pandas is incompatible with '
2020
'numpy < 1.7.0\n'
2121
'your numpy version is {0}.\n'

0 commit comments

Comments
 (0)