I have to break the records by the threshold value and print them one by one. I explain you by example-
I have dataframe with 100 records. My threshold value id 20 records at a time. So I want to print all the records in 5 times breaking 20 records at a time. I tried one sample code but that is not working.
my code:
j = 0
for i in (20,df_3.count(), 20):
print(df_3.iloc[j:i ,:].to_json(orient='records',lines=True))
time.sleep(5)
print('----------------------')
j = i
Can you please help how to get my requirement. This code is not working for me.