python - 如何控制python中bin的大小以使用numpy.histogram
问题描述
我尝试使用 numpy 包控制 bin,如下代码
bin_hights, bin_width = np.histogram(get_pdf,density=True)
有什么方法可以控制 bin 大小以使用 numpy 包?
解决方案
我使用以下方法解决了这个问题:
numpy.histogram(a, bins=15)
numpy.histogram(a, bins=10, range=None, normed=None, weights=None, density=None)
https://numpy.org/doc/stable/reference/generated/numpy.histogram.html
推荐阅读
- file - Symfony 3 上传文件 - FileNotFoundException
- windows - 如何在 VS 代码任务中获取时间戳?
- sql - MSSQL - 如果第一次返回 0,则运行第二次选择
- sql - 在同一个表中链接行是一种不好的模式吗?
- node.js - 我可以在没有 docker 的 Windows Server 上运行 Puppeteer.js 刮板吗?
- java - 更新到 Android Studio 3.2.1 后无法解析模块依赖
- javascript - 如何在 CKEditor 5 的自定义元素中插入带有标题的图像?
- regex - 在 Python 中使用正则表达式检测凌乱文本中的段落边界
- c# - 如何让 c# 进程保持活动状态(节点服务器)
- openssl - Tomcat 8.5 启动时出现 OpenSSL 异常