Author: Ming Li
Origin: upstream
Bug-Debian: https://bugs.debian.org/923708
Forwarded: not-needed
Gbp-Pq: Name array_series_matmul.patch
def __rmatmul__(self, other):
""" Matrix multiplication using binary `@` operator in Python>=3.5 """
- return self.dot(other)
+ return self.dot(np.transpose(other)).T
@Substitution(klass='Series')
@Appender(base._shared_docs['searchsorted'])
expected = np.dot(a.values, a.values)
assert_almost_equal(result, expected)
+ # np.array (matrix) @ Series (__rmatmul__)
+ result = operator.matmul(b.T.values, a)
+ expected = np.dot(b.T.values, a.values)
+ assert_almost_equal(result, expected)
+
# mixed dtype DataFrame @ Series
a['p'] = int(a.p)
result = operator.matmul(b.T, a)