diff options
-rw-r--r-- | docs/index.rst | 4 | ||||
-rw-r--r-- | pint/quantity.py | 2 | ||||
-rw-r--r-- | pint/testsuite/test_issues.py | 4 |
3 files changed, 7 insertions, 3 deletions
diff --git a/docs/index.rst b/docs/index.rst index 05cb13a..4f796b0 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -102,7 +102,7 @@ points, like positions on a map or absolute temperature scales. **Python 2 and 3**: a single codebase that runs unchanged in Python 2.7+ and Python 3.3+. -**Pandas integration**: Thanks to `Pandas Extension Types`_ it is now possible to use Pint with Pandas. Operations on DataFrames and between columns are units aware, providing even more convenience for users of Pandas DataFrames. For full details, see the `Pandas Support Documentation`_. +**Pandas integration**: Thanks to `Pandas Extension Types`_ it is now possible to use Pint with Pandas. Operations on DataFrames and between columns are units aware, providing even more convenience for users of Pandas DataFrames. For full details, see the `pint-pandas Jupyter notebook`_. When you choose to use a NumPy_ ndarray, its methods and @@ -160,4 +160,4 @@ One last thing .. _`PEP 3101`: https://www.python.org/dev/peps/pep-3101/ .. _`Babel`: http://babel.pocoo.org/ .. _`Pandas Extension Types`: https://pandas.pydata.org/pandas-docs/stable/extending.html#extension-types -.. _`Pandas Support Documentation`: ./pandas.rst +.. _`pint-pandas Jupyter notebook`: https://github.com/hgrecco/pint-pandas/blob/master/notebooks/pandas_support.ipynb diff --git a/pint/quantity.py b/pint/quantity.py index a5b40d7..3373552 100644 --- a/pint/quantity.py +++ b/pint/quantity.py @@ -71,7 +71,7 @@ def check_implemented(f): return NotImplemented # pandas often gets to arrays of quantities [ Q_(1,"m"), Q_(2,"m")] # and expects Quantity * array[Quantity] should return NotImplemented - elif isinstance(other, list) and isinstance(other[0], type(self)): + elif isinstance(other, list) and other and isinstance(other[0], type(self)): return NotImplemented result = f(self, *args, **kwargs) return result diff --git a/pint/testsuite/test_issues.py b/pint/testsuite/test_issues.py index efbaec4..df97228 100644 --- a/pint/testsuite/test_issues.py +++ b/pint/testsuite/test_issues.py @@ -653,6 +653,10 @@ class TestIssuesNP(QuantityTestCase): self.assertEqual(velocity.check('[length] / [time]'), True) self.assertEqual(velocity.check('1 / [time] * [length]'), True) + def test_issue783(self): + ureg = UnitRegistry() + assert not ureg('g') == [] + def test_issue(self): import math try: |