Python Forum
Multiply Two Time Series: Not Working - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Multiply Two Time Series: Not Working (/thread-16410.html)



Multiply Two Time Series: Not Working - brandonfoo - Feb-27-2019

Hi folks,

I am trying to multiply two time series shown below with the following command but the output is NaN.

Can someone help me?
Output:
Command>>print (portfolio.positions*portfolio.bars[['Adj Close']]) Output>> AAPL Adj Close Date 1990-01-02 NaN NaN 1990-01-03 NaN NaN 1990-01-04 NaN NaN 1990-01-05 NaN NaN ... ... ... =========================================================================================== Data for portfolio.positions as follow AAPL Date 1990-01-02 0.0 ... 2001-11-20 0.0 [3028 rows x 1 columns] =========================================================================================== Data for portfolio.bars as follow High Low ... Volume Adj Close Date ... 1990-01-02 1.339286 1.250000 ... 45799600.0 0.121996 ... ... ... ... ... 2001-12-31 1.618571 1.559286 ... 34445600.0 1.043070 [3028 rows x 6 columns] ===========================================================================================