Python Forum

Full Version: Multiply Two Time Series: Not Working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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] ===========================================================================================