Code:
import numpy as np
import pandas as pd
from datetime import datetime,date,time,timedelta
from nsepy import get_history
stocks = ['JSWSTEEL','RELIANCE','AXISBANK','HCLTECH','TECHM']
start = datetime.today() - timedelta(365)
end = datetime.today()
close_price = pd.DataFrame()
for tickers in stocks:
close_price[tickers] = get_history(tickers,start,end)
ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
ValueError: Cannot set a frame with no defined index and a value that cannot be converted to a Series
kindly help me in above code to get information for multiple stocks
Thanks