bf['Films_Year']=bf['FILM'].apply(lambda var:var.split('(')[-1])
I get this output below
films(column name)
"
2015),
2015),
2015),
2015),
2015)
"
what should I do to get my year exactly?
bf['Films_Year']=bf['FILM'].apply(lambda var:var.split('(')[-1])
I get this output below
films(column name)
"
2015),
2015),
2015),
2015),
2015)
"
what should I do to get my year exactly?
You can use .str.extract() to get the integer part using a regular expression that matches the parenthesized year at the end.
bf['Films_Year']=bf['FILM'].str.extract(r'\((\d+)\)$')