Bug#918206: Pandas new version (not?)
Rebecca N. Palmer
rebecca_palmer at zoho.com
Wed Feb 13 21:29:36 GMT 2019
This builds (including build-time tests; haven't tried the autopkgtest).
Description: Fix np.array @ DataFrame matrix multiplication
Author: jbrockmendel
Origin: upstream
https://github.com/pandas-dev/pandas/commit/ad2a14f4bec8a004b2972c12f12ed3e4ce37ff52
Bug-Debian: https://bugs.debian.org/918206
Forwarded: not-needed
--- a/pandas/core/generic.py
+++ b/pandas/core/generic.py
@@ -1602,6 +1602,7 @@ class NDFrame(PandasObject, SelectionMix
#
----------------------------------------------------------------------
# Array Interface
+ __array_priority__ = 1000
def __array__(self, dtype=None):
return com._values_from_object(self)
--- a/pandas/tests/frame/test_analytics.py
+++ b/pandas/tests/frame/test_analytics.py
@@ -2283,8 +2283,11 @@ class TestDataFrameAnalytics(TestData):
# np.array @ DataFrame
result = operator.matmul(a.values, b)
+ assert isinstance(result, DataFrame)
+ assert result.columns.equals(b.columns)
+ assert result.index.equals(pd.Index(range(3)))
expected = np.dot(a.values, b.values)
- tm.assert_almost_equal(result, expected)
+ tm.assert_almost_equal(result.values, expected)
# nested list @ DataFrame (__rmatmul__)
result = operator.matmul(a.values.tolist(), b)
More information about the debian-science-maintainers
mailing list