convert 1 min data to 3 min
#Get records
records = requests.get('https://api.stocknote.com/intraday/candleData', params={'exchange':'NFO','symbolName': token, 'fromDate': frm_date, 'interval' : interval}, headers = headers)
#Form dataframe from dict
df = pd.DataFrame.from_dict(records.json()['intradayCandleData'])
#1 min data to 3 mins
#Change type object to datetime
df['dateTime'] = pd.to_datetime(df['dateTime'])
#Set Index
df.set_index(['dateTime'],inplace=True)
#Change type object to datetime
df['close'] = df['close'].astype(float).astype(int)
#Use resample to agg
data = df['close'].resample('3min').agg({'close':'last'})