Like Left formula we Used in Excel same as I want to extract no. of character from Policy no. column based on Insurer column like.....
if insurer is HDFC then Extract only 10 character form the sting and if insurer is tata then Extract only 7 character form the sting. and if insurer other than HDFC & tata then leave it as blank.
also see hdfc insure comes with lot of different name.
How I will achieve this in python
Insurer | Policy no. | Expected OutPut |
---|---|---|
Hdfc | 4509242332 | 4509242332 |
Tata | tatadigitNational | tatadig |
Hdfc ergo | 09082323ab12sd | 09082323ab |
HDFC | nolanheroman | nolanherom |
Tata | 97543007356 | 9754300 |
Tata | pqrsequence2o202 | pqrsequ |
Tata | 987654321 | 9876543 |
HDFC health ergo | nolanheroman | nolanherom |
Digit | 1733choola | |
star | naahiHonaar |
CodePudding user response: