【Python问题】contains an element of the set of generators.

简介: 【Python问题】contains an element of the set of generators.

问题描述

求积分时如下

print(float(integrate(sympy.log(x, math.e), (x, a, b))))

报错:
contains an element of the set of generators.'

解决办法

在函数表达式前添加nsimplify,如下

print(float(integrate(nsimplify(sympy.log(x, math.e)), (x, a, b))))

参考:github上的解答

目录
相关文章
|
1月前
|
存储 JavaScript Java
(Python基础)新时代语言!一起学习Python吧!(四):dict字典和set类型;切片类型、列表生成式;map和reduce迭代器;filter过滤函数、sorted排序函数;lambda函数
dict字典 Python内置了字典:dict的支持,dict全称dictionary,在其他语言中也称为map,使用键-值(key-value)存储,具有极快的查找速度。 我们可以通过声明JS对象一样的方式声明dict
158 1
|
存储 Python
Python多个set中的交集
Python多个set中的交集
251 1
|
索引 Python 容器
为什么Python中会有集合set类型?
为什么Python中会有集合set类型?
174 3
|
并行计算 Python
Python错误笔记(一):CUDA initialization: CUDA unknown error - this may be due to an incorrectly set up env
这篇文章讨论了CUDA初始化时出现的未知错误及其解决方案,包括重启系统和安装nvidia-modprobe。
1699 0
|
Python
python中set和frozenset方法和区别
python中set和frozenset方法和区别
|
Python
python集合类型 (Set Types)
【8月更文挑战第3天】
279 9
|
JavaScript 前端开发 Python
成功解决:Can‘t find Python executable “python“, you can set the PYTHON env variable.
这篇文章分享了作者在运行前端Vue项目时遇到的关于Python执行环境的问题和解决方法。问题是由于找不到Python可执行文件导致的编译错误,解决方法包括安装编译环境、卸载并重新安装出现问题的`node-sass`包,并重新执行`npm install`和`npm run dev`。
成功解决:Can‘t find Python executable “python“, you can set the PYTHON env variable.
|
存储 数据处理 Python
Python中的Set集合:高效数据处理的利器
Python中的Set集合:高效数据处理的利器
260 0
|
数据处理 Python
【Python】已解决:SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFram
【Python】已解决:SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFram
2482 1
|
存储 Python
Python中list, tuple, dict,set的区别和使用场景
Python中list, tuple, dict,set的区别和使用场景
1021 2

推荐镜像

更多