Consider below a DataFrame with header and one row as input.. The input row needs to divided into two separate rows based on space between values or second value needs to go to second row.. So in the output we need two rows..
Input1:
Age Gender Coverage-Status Total-Paid Benefit-Date Outstanding-Reserve Waiver-Reserve Coverage-Code
31 26 M F AC CC 10,000 2/15/2011 NaN 4,743 081 010
Output Required:
Age Gender Coverage-Status Total-Paid Benefit-Date Outstanding-Reserve Waiver-Reserve Coverage Code
31 M AC 10,000 2/15/2011 NaN 4,743 081
26 F CC 010
i'm stuck at this right now,Is this possible?
i'm trying something like this :
ad['Age'] = ad.Age.str.split(expand = True).stack()
but this one doesn't seem to work...