I am trying to multiplicate a whole dataframe size 40 row * 600 columns by a pandas.core.series.Series with 40 row and only one columns. So my goal is to multiply all the rows by the unique row. And it gives me back an error.
operands could not be broadcast together with shapes (23560,) (589,)
[In] df1:
[out]
Index col1
2065-12-20 12 days
2061-10-31 12 days
2045-11-28 70 days
2043-10-31 11 days
2040-07-30 21 days
2049-06-30 64 days
2036-01-31 14 days
[In] df2:
Index col1 col2 etc....
2065-12-20 14 120
2061-10-31 18 800
2045-11-28 19 580
2043-10-31 21 12
2040-07-30 44 21
2049-06-30 1.2 17
2036-01-31 61.8 61
[in] k = df1 * df2
[out] operands could not be broadcast together with shapes (23560,) (589,)
I ultimately want
Index col1 col2 etc....
2065-12-20 14*12 120*12
2061-10-31 18*12 800*12
2045-11-28 19*70 580*70
2043-10-31 21*11 12*11
2040-07-30 44*21 21*21
2049-06-30 1.2*64 17*64
2036-01-31 61.8*14 61*61
It is probably very basic but I am stugling with it..is it because my df1 is in days? How can I transform it into regular numbers? Thank you