Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python39\lib\tkinter_init_.py", line 1892, in call
return self.func(*args)
File "c:\Users\Admin\Pictures\Saved Pictures\Crop-Recommendation\gui.py", line 108, in
button = tk.Button(root,text="Submit",font=40,command=lambda: self_function())
File "c:\Users\Admin\Pictures\Saved Pictures\Crop-Recommendation\gui.py", line 14, in self_function
label['text'] = pre(a,b)
File "c:\Users\Admin\Pictures\Saved Pictures\Crop-Recommendation\backend.py", line 25, in pre
c = classifier.predict(Z)
File "C:\Python39\lib\site-packages\sklearn\tree_classes.py", line 442, in predict
X = self._validate_X_predict(X, check_input)
X = self._validate_data(X, dtype=DTYPE, accept_sparse="csr",
File "C:\Python39\lib\site-packages\sklearn\base.py", line 421, in validate_data
X = check_array(X, **check_params)
File "C:\Python39\lib\site-packages\sklearn\utils\validation.py", line 63, in inner_f
return f(*args, **kwargs)
File "C:\Python39\lib\site-packages\sklearn\utils\validation.py", line 726, in check_array
raise ValueError("Found array with %d sample(s) (shape=%s) while a"
ValueError: Found array with 0 sample(s) (shape=(0, 2)) while a minimum of 1 is required.
PS C:\Users\Admin\Pictures\Saved Pictures\Crop-Recommendation> c:; cd 'c:\Users\Admin\Pictures\Saved Pictures\Crop-Recommendation'; & 'C:\Python39\python.exe' 'c:\Users\Admin.vscode\extensions\ms-python.python-2021.9.1246542782\pythonFiles\lib\python\debugpy\launcher' '64341' '--' 'c:\Users\Admin\Pictures\Saved Pictures\Crop-Recommendation\gui.py'
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python39\lib\tkinter_init.py", line 1892, in call
return self.func(*args)
File "c:\Users\Admin\Pictures\Saved Pictures\Crop-Recommendation\gui.py", line 108, in
button = tk.Button(root,text="Submit",font=40,command=lambda: test_function())
File "c:\Users\Admin\Pictures\Saved Pictures\Crop-Recommendation\gui.py", line 14, in test_function
label['text'] = pre(a,b)
File "c:\Users\Admin\Pictures\Saved Pictures\Crop-Recommendation\backend.py", line 25, in pre
c = classifier.predict(Z)
File "C:\Python39\lib\site-packages\sklearn\tree_classes.py", line 442, in predict
X = self._validate_X_predict(X, check_input)
File "C:\Python39\lib\site-packages\sklearn\tree_classes.py", line 407, in _validate_X_predict
X = self._validate_data(X, dtype=DTYPE, accept_sparse="csr",
File "C:\Python39\lib\site-packages\sklearn\base.py", line 421, in _validate_data
X = check_array(X, **check_params)
File "C:\Python39\lib\site-packages\sklearn\utils\validation.py", line 63, in inner_f
return f(*args, **kwargs)
File "C:\Python39\lib\site-packages\sklearn\utils\validation.py", line 726, in check_array
raise ValueError("Found array with %d sample(s) (shape=%s) while a"
ValueError: Found array with 0 sample(s) (shape=(0, 2)) while a minimum of 1 is required.