I have the current code that splits records if a / occurs in the value but I want it to be cloned and retain the non med or 65+ suffix (best method to identify the suffix is probably by using the first space as a delimiter). The Desired out is what I want the output to look like. Current Out is what the code below is outputting
dfRosters=(dfRosters.set_index(['Volume', 'Premium'])
.apply(lambda x: x.str.split('/').explode())
.reset_index())
In
29 312889.0 159834.15 5455/5456 (non med)
56 4168.0 2984.15 7065/7066 65+
26 45405.0 21013.45 5113.0
Desired Out
29 312889.0 159834.15 5455 (non med)
29 312889.0 159834.15 5456 (non med)
56 4168.0 2984.15 7065
56 4168.0 2984.15 7066 65+
26 45405.0 21013.45 5113.0
Current Out
29 312889.0 159834.15 5455
29 312889.0 159834.15 5456 (non med)
56 4168.0 2984.15 7065 65+
56 4168.0 2984.15 7066 65+
26 45405.0 21013.45 5113.0