Getting an error “ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()”

cols = [‘Restaurant’,’Average_Cost_Cleaned’,’Delivery_Time’,’Minimum_Order_Cleaned’, ‘Rating_Cleaned’,’Reviews_Cleaned’,’Votes_Cleaned’].index # Kindly Note: If I’m not using .index the the below code is showing the error as “KeyError: “[‘Reviews_Cleaned’, ‘Votes_Cleaned’] not in index” train_sample = train[cols] test_sample = test[cols[:-1]] Error: ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

Details

how to applying Cross Validation for all 10 fold (training and testing)?

I have this code and I want to apply 10 fold cross-validation for all fold(testing and training), The code below is only applied for one fold. how to write a loop for all fold (9 fold for Training, 1 fold for testing and loop for all fold)? dataset=pd.read_csv(“C:/Users/User/Desktop/minority class equal.csv”,encoding=’cp1252′) dataset.shape #output(53480, 37) array =…

Details