Please any will give solution on said queries....!

PS E:\API> & C:/Users/Admin/AppData/Local/Programs/Python/Python313/python.exe e:/API/test.py
YF.download() has changed argument auto_adjust default to True
[100%**] 2 of 3 completed

1 Failed download:
[‘IRDA.NS’]: HTTPError('HTTP Error 404: ')
[100%**] 2 of 3 completedTraceback (most recent call last):
File “e:\API\test.py”, line 29, in
df[‘upper_band’], df[‘middle_band’], df[‘lower_band’] = ta.BBANDS(df[‘Close’]),
~~~~~~~~~^^^^^^^^^^^^^
File “C:\Users\Admin\AppData\Local\Programs\Python\Python313\Lib\site-packages\talib_init_.py”, line 80, in wrapper
result = func(*_args, **_kwds)
TypeError: Argument ‘real’ has incorrect type (expected numpy.ndarray, got DataFrame)
PS E:\API>

Hi @Prasad.kulkarni, While we are unable to assist directly with the coding aspect, we encourage you to share any difficulties you’re facing with the base response structure. Our community members @t7support @Shubham_Singh @Hardik are here to help and can provide valuable insights or guidance.

@Prasad.kulkarni

The error you’re encountering comes from the talib.BBANDS() function. The issue is that it expects a numpy.ndarray for the real argument (the series you’re passing), but you’re giving it a pandas.DataFrame. The fix is to extract the relevant column (likely 'Close') from your DataFrame and convert it to a numpy array before passing it to BBANDS().

This may help

df[‘upper_band’], df[‘middle_band’], df[‘lower_band’] = ta.BBANDS(df[‘Close’].values)

1 Like