If pandas df looks like that:
Id Name Gene
1 ARR_R C
1 AR2 C
1 A3412d_R C
1 Asfsvv C
1 A_RUUYR_R C
And I need to delete for example _R but only if it occurs in for example 5 last chars.
I tried this way:
df['Name']=(df.Name.replace({'_R':''}, regex=True))
But in this example code change A_RUUYR_R to 'AUUYR' and should be A_RUUYR. It's possible to command replace function to start from the end?