File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -944,7 +944,9 @@ def dot(self, other):
944
944
Notes
945
945
-----
946
946
The dimensions of DataFrame and other must be compatible in order to
947
- compute the matrix multiplication.
947
+ compute the matrix multiplication. In addition, the column names of
948
+ DataFrame and the index of other must contain the same values, as they
949
+ will be aligned prior to the multiplication.
948
950
949
951
The dot method for Series computes the inner product, instead of the
950
952
matrix product here.
@@ -982,6 +984,14 @@ def dot(self, other):
982
984
0 1
983
985
0 1 4
984
986
1 2 2
987
+
988
+ Note how shuffling of the objects does not change the result.
989
+
990
+ >>> s2 = s.reindex([1, 0, 2, 3])
991
+ >>> df.dot(s2)
992
+ 0 -4
993
+ 1 5
994
+ dtype: int64
985
995
"""
986
996
if isinstance (other , (Series , DataFrame )):
987
997
common = self .columns .union (other .index )
You can’t perform that action at this time.
0 commit comments