File "C:\Users\Student\anaconda3\lib\site-packages\spyder\plugins\editor\widgets\codeeditor.py", line 1392, in handle_hover_response
self.sig_display_object_info.emit(content,
TypeError: CodeEditor.sig_display_object_info[str, bool].emit(): argument 1 has unexpected type 'list'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Student\anaconda3\lib\logging\__init__.py", line 1081, in emit
msg = self.format(record)
File "C:\Users\Student\anaconda3\lib\logging\__init__.py", line 925, in format
return fmt.format(record)
File "C:\Users\Student\anaconda3\lib\logging\__init__.py", line 664, in format
record.message = record.getMessage()
File "C:\Users\Student\anaconda3\lib\logging\__init__.py", line 369, in getMessage
msg = msg % self.args
ValueError: incomplete format
Call stack:
File "C:\Users\Student\anaconda3\Scripts\spyder-script.py", line 10, in <module>
sys.exit(main())
File "C:\Users\Student\anaconda3\lib\site-packages\spyder\app\start.py", line 205, in main
mainwindow.main()
File "C:\Users\Student\anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 3763, in main
mainwindow = run_spyder(app, options, args)
File "C:\Users\Student\anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 3679, in run_spyder
app.exec_()
File "C:\Users\Student\anaconda3\lib\site-packages\spyder\plugins\completion\languageserver\client.py", line 493, in on_msg_received
self.req_reply[req_id](None, {'params': []})
File "C:\Users\Student\anaconda3\lib\site-packages\spyder\plugins\completion\languageserver\plugin.py", line 548, in receive_response
self.sig_response_ready.emit(
File "C:\Users\Student\anaconda3\lib\site-packages\spyder\plugins\completion\plugin.py", line 123, in receive_response
self.howto_send_to_codeeditor(req_id)
File "C:\Users\Student\anaconda3\lib\site-packages\spyder\plugins\completion\plugin.py", line 177, in howto_send_to_codeeditor
self.skip_and_send_to_codeeditor(req_id)
File "C:\Users\Student\anaconda3\lib\site-packages\spyder\plugins\completion\plugin.py", line 205, in skip_and_send_to_codeeditor
self.gather_and_send_to_codeeditor(request_responses)
File "C:\Users\Student\anaconda3\lib\site-packages\spyder\plugins\completion\plugin.py", line 273, in gather_and_send_to_codeeditor
response_instance.handle_response(req_type, responses)
File "C:\Users\Student\anaconda3\lib\site-packages\spyder\plugins\editor\widgets\codeeditor.py", line 1019, in handle_response
handler(params)
File "C:\Users\Student\anaconda3\lib\site-packages\spyder\plugins\editor\widgets\codeeditor.py", line 1406, in handle_hover_response
self.log_lsp_handle_errors("Error when processing hover")
File "C:\Users\Student\anaconda3\lib\site-packages\spyder\plugins\editor\widgets\codeeditor.py", line 1050, in log_lsp_handle_errors
logger.error('%', 1, stack_info=True)
Message: '%'
Arguments: (1,)
Description
What steps will reproduce the problem?
I'm trying to learn how to code
import sympy as sym # used for symbolic manipulation of mathematical expressions
x_1 = sym.symbols('x_1') x_2 = sym.symbols('x_2') x_3 = sym.symbols('x_1') x_4 = sym.symbols('x_2') y = sym.symbols('y')
def fd1(x_1,x_2): return (339-.01x_1-.003x_2)x_1 + (399 - .004x_1 - .01x_2)x_2 - (400000+ 195x_1 + 225x_2)
print("The function is defined by fd1(x) =",fd1(x_1,x_2), ".\n") dfdx_1 = sym.diff(fd1(x_1, x_2=x_2),x_1) # take the derivative with respect to x_1
dfdx_1_crpt = sym.solve(dfdx_1, x_1)
print("The derivative is with respect to x_1 is", sym.simplify(dfdx_1), ".\n") print("The critical points are", dfdx_1_crpt,".\n")
f_terms_of_x_1 = dfdx_1_crpt[0] print("Thus x_1 as a function of x_2 is x=", f_terms_of_x_1, ".\n" )
def fd2(x_4,x_3): return (339-.01x_3-.003x_4)x_3 + (399 - .004x_3 - .01x_4)x_4 - (400000+ 195x_3 + 225x_4)
print("The function is defined by fd2(x) =",fd2(x_3,x_4), ".\n") dfdx_2 = sym.diff(fd2(x_4, x_3=x_3),x_4) # take the derivative with respect to x_4
dfdx_2_crpt = sym.solve(dfdx_2, x_4)
print("The derivative is with respect to x_2 is", sym.simplify(dfdx_2), ".\n") print("The critical points are", dfdx_2_crpt,".\n")
f_terms_of_x_2 = dfdx_2_crpt[0] print("Thus x_2 as a function of x_1 is x=", f_terms_of_x_2, ".\n" )
print("The critical points are", dfdx_2_crpt,".\n")
x_1_x_2_sys_crit = sym.solve((dfdx_1,dfdx_2), x_1,x_2)
print("The point(dx_1,dx_2) def by, fd1(dx_1,dx_2), represents the global maximum", x_1_x_2_sys_crit)
print("to interpret",x_1_x_2_sys_crit,"so that it can be used in our code. We put them into a set?\n")
x_1_crit = x_1_x_2_sys_crit[x_1] x_2_crit = x_1_x_2_sys_crit[x_2]
print("these are the values as numbers outside or inside a set?",x_1_crit,x_2_crit)
global_multi_var_sol = sym.solve(fd1(x_1=[x_1],x_2=[x_2]),[x_1],[x_2])
global_multi_var_sol = sym.solve(fd1(x_1=x_1_crit,x_2=x_2_crit),[x_1],[x_2])
print(global_multi_var_sol)
Traceback
Versions
Dependencies