Skip to content

Instantly share code, notes, and snippets.

@kusal1990
Created June 24, 2022 07:39
Show Gist options
  • Save kusal1990/239fcd0554ff93de433afd4b66a527f5 to your computer and use it in GitHub Desktop.
Save kusal1990/239fcd0554ff93de433afd4b66a527f5 to your computer and use it in GitHub Desktop.
def extract_question(question):
'''
This function will take a value in question column then, will split the string
at (A) or (1). After splitting we will take only first part which is the question.
'''
if '(A)' in question:
x = question.split('(A)')[0]
elif '(1)' in question:
x = question.split('(1)')[0]
return x
@kusal1990
Copy link
Author

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment