I have a problem with deciding which value should I take for a new column in a dataframe that I will create. Here's the requirements:
- The value should have length=17
- The value should contains "MP" and the format is XXMPXXXXXXXXXXXX
And here's the data:
| Serial Number New | Serial Number + Keyword | Serial Number Old |
|---|---|---|
| 12MP3221156732243 | 12MP3221156732243 Restaurant | 12MP3221156732243 |
| 0 | Retail 12MP3251453730827 | 3251453730827 |
| 0 | K312MP3251773832657 | 3251773832657 |
| 11MP3221156732243 | 11MP3221156732243 | MP3221156732243 |
| 11MP3251156732267 | 0 | MP3251156732267 |
And here's the expected output:
| Serial Number New | Serial Number + Keyword | Serial Number Old | Serial Number Final |
|---|---|---|---|
| 12MP3221156732243 | 12MP3221156732243 Restaurant | 12MP3221156732243 | 12MP3221156732243 |
| 0 | Retail 12MP3251453730827 | 3251453730827 | 12MP3251453730827 |
| 0 | K312MP3251773832657 | 3251773832657 | 12MP3251773832657 |
| 11MP3221156732243 | 11MP3221156732243 | MP3221156732243 | 11MP3221156732243 |
| 11MP3251156732267 | 0 | MP3251156732267 | 11MP3251156732267 |
Does anyone know how to get the "Serial Number Final" value?