I have an 200 rows in Pandas Serias all_data['close']
and need to compare few last rows with m_a
last rows. Here's my code:
import pandas as pd
from talib import SMA
all_data = pd.DataFrame({
'open': [item[1] for item in data],
'close': [item[4] for item in data],
})
m_a = SMA(all_data['close'], timeperiod=5)
From here I need to find a way how to compare values from all_data['close']
and m_a
. I tried this way:
print(m_a[-1:])
But I only can get this value:
199 0.00001103
dtype: float64
I need that number - 0.00001103
, so if I make something like this
print(m_a[-1:].item())
I get a value like this 1.1027070707070725e-05
and it's not what I'm looking for.