I'm trying to create a new column with values from another columns string What I want is to create a new column with unit values.
The position of the units can vary.
The examples of my strings are
this is a string and we have 4U to use
this is another string 5UN
only 6U to use today
I need to extract the numbers that are joined to both U and UN since the positions vary.
df['test_units'] = df['ITEM_DESC'].str.get(r'\(*U.*?\)',)
df['test_units']
This is my regex but I return only nan values.
How do I just return the number that's joined to a U Or UN?