Created two series: s1
and s2
from df
.
Each have same length but differing indices. s1.multiply(s2)
unions the mismatched indices instead of multiplying against them.
I just want to multiply entrywise s1
against s2
ignoring the mismatched indices.
I could run s1.reset_index()
and s2.reset_index()
and then take the column I want from these two dfs, since it turns the original index into a separate column, but that's tedious and I thought there might be a simpler way to do it.
s1.multiply(s2, axis='columns')
doesn't seem to work either
values
:s1.values.mul(s2.values)
. – Pietras1 * s2.values
should work – Samul[0,1,2...]
index whereas Ed's suggestion will use the index froms1
– Pietra