This is my code. I tried to concatenate the data but it is showing the empty dataframe. I want the details of symbols provided in the list as output which will be in the form of dataframe.
import pandas as pd
from nsepy import get_history
from datetime import date
symbol=['SBIN','ITC']
data1=[]
data1= pd.DataFrame(data1)
counter=0
for x in symbol:
data = get_history(symbol=x, start=date(2022,4,25), end=date(2022,5,5), index= True)
data = pd.DataFrame(data)
data1= pd.concat([data1,data])
print(x)
print(data1)
The output I am getting is:
SBIN
Empty DataFrame
Columns: [Open, High, Low, Close, Volume, Turnover]
Index: []
ITC
Empty DataFrame
Columns: [Open, High, Low, Close, Volume, Turnover]
Index: []