I am printing my list of usernames using the below code:
df1 = pd.DataFrame({'Username':commentor_list})
df1.assign(Username=df1.Username.str.split(",")).explode('Username')
However, some usernames output with the extra info like the following:
Alice (10 videos / 58 subscribers)
Bob
Charles (20 videos / 28 subscribers)
Diana
I want to extract my first names to get
Alice
Bob
Charles
Diana
I've tried using a code below, as well as the '[\S]' and '[\w] ' but nothing works. I get my error 'pattern contains no capture groups'
df1['Username'] = df1['Username'].str.extract('[?:\S]')
print(df1)