I have a dataframe which i have to split as soon as a specific string value in a column occurs. Ex. df =
txn_details amt
0 opening_balance 13000
1 opening_balance 15000
2 upi2873 12879
3 upi182y31 12301
4 opening_balance 85050
5 upi79279831 8400
The desired output(3 dataframes)(may vary depending on the no. of occurrences of 'opening_balance'): df_1 =
txn_details amt
0 opening_balance 13000
df_2 =
txn_details amt
0 opening_balance 15000
1 upi2873 12879
2 upi182y31 12301
df_3 =
txn_details amt
0 opening_balance 85050
1 upi79279831 8400
I've tried using cumsum() function in pandas but not getting the desired output.