mercredi 27 février 2019

After getting an input from a user I receive an error when apply if statement condition

store_data = pd.read_csv('/Users/user/PycharmProjects/Apriori /heart_disease.csv')

name = raw_input("Disease prediction? (Yes, No)")
type(name)

if name == 'Yes':
    df1 = store_data[['DIAB','AL ','SEX']]  #itemset filteration

elif name == 'No':
    df1 = store_data[['DIAB','SMOK','CHOL']]

I keep getting

File "", line 1 elif name == 'No': ^ SyntaxError: invalid syntax

The same happens when I try to use else with no condition

else: 
df1 = store_data[['DIAB','SMOK','CHOL']]

Aucun commentaire:

Enregistrer un commentaire