Pandas DataFrame: dot() function

DataFrame - dot() function

The dot() function is used to compute the matrix multiplication between the DataFrame and other.


DataFrame.dot(self, other)


Name Description Type/Default Value Required / Optional

The other object to compute the matrix product with.

Series, DataFrame or array-like Required

Returns: Series or DataFrame
If other is a Series, return the matrix product between self and other as a Serie. If other is a DataFrame or a numpy.array, return the matrix product of self and other in a DataFrame of a np.array.


The dimensions of DataFrame and other must be compatible in order to compute the matrix multiplication. In addition, the column names of DataFrame and the index of other must contain the same values, as they will be aligned prior to the multiplication.
The dot method for Series computes the inner product, instead of the matrix product here.


Download the Pandas DataFrame Notebooks from here.

Previous: DataFrame - pow() function
Next: DataFrame - radd() function

Follow us on Facebook and Twitter for latest update.