You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when dataframe.__rmatmul__ is triggered, the DataFrame.dot is called. However, the error message doesn't seem to align with numpy.
importnumpyasnpfrompandasimport*a=np.random.rand(10, 4)
b=np.random.rand(5, 3)
df=DataFrame(b)
# a.__matmul__ is calleda @ df# df.__rmatmul__ is calleda.tolist() @ df
Problem description
>>> # a.__matmul__ is called
... a @ df
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
ValueError: shapes (10,4) and (5,3) not aligned: 4 (dim 1) != 5 (dim 0)
>>>
>>> # df.__rmatmul__ is called
... a.tolist() @ df
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "/Users/mingli/GitHub/open/pandas/pandas/core/frame.py", line 901, in __rmatmul__
return self.T.dot(np.transpose(other)).T
File "/Users/mingli/GitHub/open/pandas/pandas/core/frame.py", line 879, in dot
r=rvals.shape))
ValueError: Dot product shape mismatch, (3, 5) vs (4, 10)
Expected Output
ValueError: Dot product shape mismatch, (10, 4) vs (5, 3)
Code Sample, a copy-pastable example if possible
when
dataframe.__rmatmul__
is triggered, the DataFrame.dot is called. However, the error message doesn't seem to align with numpy.Problem description
Expected Output
Output of
pd.show_versions()
pandas: 0.24.0.dev0+147.g7a74af7ec
pytest: 3.6.1
pip: 10.0.1
setuptools: 28.8.0
Cython: 0.28.3
numpy: 1.14.5
scipy: None
pyarrow: None
xarray: None
IPython: None
sphinx: 1.7.5
patsy: None
dateutil: 2.7.3
pytz: 2018.4
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: