I have a Pandas dataframe full of questions. My program goes through each question and asks the user if the question is okay or if it needs to be changed or dropped from the matrix - I haven't been able to get either to take.
df1 = pd.read_csv('questions.csv', usecols=['question_id','question'])
for index, row in df1.iterrows():
print(row['question'])
Check1 = input("Is the following question correct? (Y/N): ")
if Check1 == "Y":
continue
elif Check1 == "N":
Check2 = input("Is this question Needed? (Y/N):")
if Check2 == "N":
Check3 = input("Are you sure you want to Delete this question? (Y/N)")
if Check3 == "Y":
df1.drop(df1.index[index], inplace=True)
elif Check2 == "Y":
Check4 = input("Please rewrite the question: ")
df1['question'] = df1.replace(['question'],'Check4')
Looking for help with df1.drop - if I need to remove the whole row. or df1.replace if I need to just replace the one cell value.
Thanks in advance.
Edit: Here is my data set - the numbers are identifiers:
question_id,question
12,What is your number?
10,What is your email?
6,What is your Job title?
30,What color is your car?]