python - Pandas two dataframes multiplication? -


i have 2 data frames (a , b)

a: column 1, column 2, column 3 0.1        0.5       0.7   b: row 1          5 row 2          6 row 3          7 

how perform multiplication like

(0.1)*5,  (0.5)* 6,  , (0.7)*7? 

in other words, how multiply value in first row of b value in first column of a, second row of b value in second column of b, , etc?

you want multiply values without respect whether rows or columns.

pd.series(a.values.ravel() * b.values.ravel())  0    0.5 1    3.0 2    4.9 dtype: float64 

Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -