I'm trying to strip the end of the strings in this column. I've seen how to rstrip a specific character, or a set number of characters at the end of a string, but how do you do it based on a pattern?
I'd like to remove the entire end of the strings in the 'team' column at where we see a lowercase followed by an upper case. Then remove starting at the uppercase. I would like the below 'team' column:
team pts/g
St. Louis RamsSt. Louis 32.875
Washington RedskinsWashington 27.6875
Minnesota VikingsMinnesota 24.9375
Indianapolis ColtsIndianapolis 26.4375
Oakland RaidersOakland 24.375
Carolina PanthersCarolina 26.3125
Jacksonville JaguarsJacksonville 24.75
Chicago BearsChicago 17.0
Green Bay PackersGreen Bay 22.3125
San Francisco 49ersSan Francisco 18.4375
Buffalo BillsBuffalo 20.0
to look like this:
team pts/g
St. Louis Rams 32.875
Washington Redskins 27.6875
Minnesota Vikings 24.9375
Indianapolis Colts 26.4375
Oakland Raiders 24.375
Carolina Panthers 26.3125
Jacksonville Jaguars 24.75
Chicago Bears 17.0
Green Bay Packers 22.3125
San Francisco 49ers 18.4375
Buffalo Bills 20.0