Examples
Multiply a DataFrame with a Series:
import numpy as np
import pandas as pd
df = pd.DataFrame([[0, 2, -1, -2], [2, 2, 2, 2]])
s = pd.Series([2, 1, 2, 1])
df.dot(s)
Multiply a DataFrame with another DataFrame:
other = pd.DataFrame([[0, 2], [1, 2], [-2, -1], [2, 0]])
df.dot(other)
The dot method give the same result as @:
df @ other
The dot method works also if other is an np.array:
arr = np.array([[0, 2], [1, 2], [-2, -1], [2, 0]])
df.dot(arr)
Shuffling of the objects does not change the result:
s2 = s.reindex([2, 0, 1, 3])
df.dot(s2)