Python Remove Text After Substring Function In R