Got an error while validating Pan card number from dataframe

Viewed 26

I got an error while validating pan card number.

Error : _() got an unexpected keyword argument 'regex'

I used the following code

import pandas as pd
import numpy as np
from re import *

pannoDF['pannoDF'] = np.where(pannoDF.PAN_NO.str.contains(r"^[A-Z]{5}\d{4}[A-Z]$",regex=True), 'Valid PAN' , 'is not valid PAN number')

spark version - '3.2.1'

can you please suggest the solution?

0 Answers
Related