Develop a Stock Portfolio Screener in Excel using Python and Grok Chatbot AI

Develop a Stock Portfolio Screener in Excel using Python and Grok Chatbot AI:


For Instructions Follow the Video then go For the Code Input:



import pandas as pd  
instruments=pd.read_csv('https://assets.upstox.com/market-quote/instruments/exchange/complete.csv.gz')
instruments=instruments[instruments['instrument_type']=='FUTSTK'].sort_values(by='last_price')
instruments['Symbol']=instruments['tradingsymbol'].str.extract(r'([A-Z-&]+)').drop_duplicates()
tradingsymbol=instruments[['Symbol','last_price']]
print(len(tradingsymbol[1:]),tradingsymbol[1:].dropna().set_index('Symbol').to_excel('NSE.xlsx',header=['Price']))


For Instructions Follow the Video then go For the Code Input:



import pandas as pd  
instruments=pd.read_csv('https://assets.upstox.com/market-quote/instruments/exchange/complete.csv.gz')
instruments=instruments[instruments['instrument_type']=='FUTSTK'].sort_values(by='last_price')
instruments['Symbol']=instruments['tradingsymbol'].str.extract(r'([A-Z-&]+)').drop_duplicates()
tradingsymbol=instruments[['Symbol','last_price']].dropna()
tradingsymbol=tradingsymbol[tradingsymbol['last_price'].apply(lambda x:x<500)]
print(len(tradingsymbol[1:]),tradingsymbol[1:].set_index('Symbol').to_excel('NSE_500.xlsx',header=['Price']))