简体   繁体   English

我的代码有问题。 我需要解决这个错误。 帮我

[英]I have a problem with a code. I need to solve this error. Help me

My code is in the picture How I solve this error?我的代码在图片中我如何解决这个错误?

from sympy import *
import math
import numpy as np
from scipy.misc import derivative
x = Symbol ('x')
f = x*sin*(x) *exp**(-x**2)
derivative = f.diff(x)
print(derivative)

TypeError: unsupported operand type(s) for *: 'Symbol' and 'FunctionClass' TypeError: *: 'Symbol' 和 'FunctionClass' 不支持的操作数类型

You have extra stars * .你有额外的星星* Here is how it should be:应该是这样的:

f = x*sin(x) * exp(-x**2)

sin and exp are functions. sinexp是函数。 A single * is multiplication, and ** is exponentiation.单个*是乘法,而**是求幂。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我有这段代码,试图通过捕获视频来运行社会隔离识别,但我有这个错误。 你可以帮帮我吗? - I have this code, trying to run a social isolation identification by capturing video, but I have this error. Could you help me? 运行此 python 代码时出现错误。 错误是“ElementNotInteractableException”。 任何人都可以帮助我吗? - I am getting error while running this python code. The error is “ElementNotInteractableException”. Can any on help me out? 我正在用瓶子写一个小应用程序。 我有一些概念上的问题帮助我解决它 - I am writing a small app in bottle. I have some conceptual problem help me to solve it out 我有以下代码抛出和错误。 - I have the following code throwing and error. 嗨,我尝试用 python 编写这段代码,但是我有一个错误,我希望有人可以帮助我 - Hi, I have tried to write this code in python, but i have a error, i hope that someone could help me 我需要一些帮助来解决我的 opencv 程序的这个问题吗? - I need some help to solve this problem with my opencv program please? 我需要帮助完成我的代码。 注意我是 Python 的初学者 - I need help completing my code. Note I am a beginner in Python 我不明白以下代码的行为。 有人可以帮我吗 - I don't understand the behavior of this below code. Can someone help me here 我不断收到索引错误。 我不知道我应该在哪里更改我的代码。 这是我的代码 - I keep on getting index error. i dont know where should i change my code. here are my codes 您好,当我在 Jupyter 笔记本中执行此查询时,它会显示错误。 请帮帮我 - Hello When I execute this query in my Jupyter notebook it shows me error. Please help me out
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM