6
möchte ich multiplcation eines Pandas Datenrahmen und eine Reihe eine Matrix tunMatrixmultiplikation eines Pandas Datenrahmen und Serie
df = pandas.DataFrame({'a':[4,1,3], 'b':[5,2,4]},index=[1,2,3])
ser = pandas.Series([0.6,0.4])
df ist,
a b
1 4 5
2 1 2
3 3 4
ser ist,
0 0.6
1 0.4
Mein gewünschtes Ergebnis ist ein Matrixprodukt, so wie
ans ist,
ich meine Dataframe numpy Punkt-Operator durch die Verwendung und den Wiederaufbau dies tun können
c = a.values.dot(b.transpose())
c = pandas.DataFrame(c, index = a.index, columns = ['ans'])
print c
ans
1 4.4
2 1.4
3 3.4
Gibt es eine native Methode in Pandas dies zu tun?